Class: Propertyware::InspectionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/propertyware/api/inspections_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InspectionsApi

Returns a new instance of InspectionsApi.



19
20
21
# File 'lib/propertyware/api/inspections_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/propertyware/api/inspections_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_inspection(inspection_id, opts = {}) ⇒ Inspection

Retrieve a inspection Retrieves a specific inspection.<br/><br/>Required permission:<br/><span class="permissionBlock">INSPECTIONS</span> - Read

Parameters:

  • inspection_id (Integer)

    Inspection ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_custom_fields (Boolean)

    includeCustomFields (default to true)

Returns:



28
29
30
31
# File 'lib/propertyware/api/inspections_api.rb', line 28

def get_inspection(inspection_id, opts = {})
  data, _status_code, _headers = get_inspection_with_http_info(inspection_id, opts)
  data
end

#get_inspection_with_http_info(inspection_id, opts = {}) ⇒ Array<(Inspection, Integer, Hash)>

Retrieve a inspection Retrieves a specific inspection.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;INSPECTIONS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt;

Parameters:

  • inspection_id (Integer)

    Inspection ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_custom_fields (Boolean)

    includeCustomFields (default to true)

Returns:

  • (Array<(Inspection, Integer, Hash)>)

    Inspection data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/propertyware/api/inspections_api.rb', line 39

def get_inspection_with_http_info(inspection_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InspectionsApi.get_inspection ...'
  end
  # verify the required parameter 'inspection_id' is set
  if @api_client.config.client_side_validation && inspection_id.nil?
    fail ArgumentError, "Missing the required parameter 'inspection_id' when calling InspectionsApi.get_inspection"
  end
  # resource path
  local_var_path = '/inspections/{inspectionId}'.sub('{' + 'inspectionId' + '}', CGI.escape(inspection_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeCustomFields'] = opts[:'include_custom_fields'] if !opts[:'include_custom_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Inspection'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"InspectionsApi.get_inspection",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InspectionsApi#get_inspection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_inspections(opts = {}) ⇒ Array<Inspection>

Retrieve all inspections Retrieves a list of inspections.<br/><br/>Required permission:<br/><span class="permissionBlock">INSPECTIONS</span> - Read <br/><br/>Sortable by: createddate, number, lastmodifieddatetime, status, id

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :status (String)

    Filters results to inspections with a specific status.

  • :portfolio_id (Integer)

    Filters results to inspections associated with a specific portfolio.

  • :building_id (Integer)

    Filters results to inspections associated with a specific building.

  • :type (String)

    Filters results to inspections with a specific type.

Returns:



101
102
103
104
# File 'lib/propertyware/api/inspections_api.rb', line 101

def get_inspections(opts = {})
  data, _status_code, _headers = get_inspections_with_http_info(opts)
  data
end

#get_inspections_with_http_info(opts = {}) ⇒ Array<(Array<Inspection>, Integer, Hash)>

Retrieve all inspections Retrieves a list of inspections.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;INSPECTIONS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt; &lt;br/&gt;&lt;br/&gt;&lt;b&gt;Sortable by:&lt;/b&gt; &lt;code&gt;createddate&lt;/code&gt;, &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;lastmodifieddatetime&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :status (String)

    Filters results to inspections with a specific status.

  • :portfolio_id (Integer)

    Filters results to inspections associated with a specific portfolio.

  • :building_id (Integer)

    Filters results to inspections associated with a specific building.

  • :type (String)

    Filters results to inspections with a specific type.

Returns:

  • (Array<(Array<Inspection>, Integer, Hash)>)

    Array<Inspection> data, response status code and response headers



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/propertyware/api/inspections_api.rb', line 119

def get_inspections_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InspectionsApi.get_inspections ...'
  end
  # resource path
  local_var_path = '/inspections'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'lastModifiedDateTimeStart'] = opts[:'last_modified_date_time_start'] if !opts[:'last_modified_date_time_start'].nil?
  query_params[:'lastModifiedDateTimeEnd'] = opts[:'last_modified_date_time_end'] if !opts[:'last_modified_date_time_end'].nil?
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'portfolioID'] = opts[:'portfolio_id'] if !opts[:'portfolio_id'].nil?
  query_params[:'buildingID'] = opts[:'building_id'] if !opts[:'building_id'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Inspection>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"InspectionsApi.get_inspections",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InspectionsApi#get_inspections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end