Class: Pipedrive::ItemSearchApi
- Inherits:
-
Object
- Object
- Pipedrive::ItemSearchApi
- Defined in:
- lib/pipedrive-openapi-client/api/item_search_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ ItemSearchApi
constructor
A new instance of ItemSearchApi.
-
#item_search_field_get(term, field_type, field_key, opts = {}) ⇒ BaseResponse
Perform a search using a specific field from an item type Performs a search from the values of a specific field.
-
#item_search_field_get_with_http_info(term, field_type, field_key, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Perform a search using a specific field from an item type Performs a search from the values of a specific field.
-
#item_search_get(term, opts = {}) ⇒ BaseResponse
Perform a search from multiple item types Performs a search from your choice of item types and fields.
-
#item_search_get_with_http_info(term, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Perform a search from multiple item types Performs a search from your choice of item types and fields.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ItemSearchApi
Returns a new instance of ItemSearchApi.
19 20 21 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#item_search_field_get(term, field_type, field_key, opts = {}) ⇒ BaseResponse
Perform a search using a specific field from an item type Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (Deals, Persons, Organizations or Products).
33 34 35 36 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 33 def item_search_field_get(term, field_type, field_key, opts = {}) data, _status_code, _headers = item_search_field_get_with_http_info(term, field_type, field_key, opts) data end |
#item_search_field_get_with_http_info(term, field_type, field_key, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Perform a search using a specific field from an item type Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (Deals, Persons, Organizations or Products).
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 49 def item_search_field_get_with_http_info(term, field_type, field_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ItemSearchApi.item_search_field_get ...' end # verify the required parameter 'term' is set if @api_client.config.client_side_validation && term.nil? fail ArgumentError, "Missing the required parameter 'term' when calling ItemSearchApi.item_search_field_get" end # verify the required parameter 'field_type' is set if @api_client.config.client_side_validation && field_type.nil? fail ArgumentError, "Missing the required parameter 'field_type' when calling ItemSearchApi.item_search_field_get" end # verify enum value allowable_values = ["dealField", "personField", "organizationField", "productField"] if @api_client.config.client_side_validation && !allowable_values.include?(field_type) fail ArgumentError, "invalid value for \"field_type\", must be one of #{allowable_values}" end # verify the required parameter 'field_key' is set if @api_client.config.client_side_validation && field_key.nil? fail ArgumentError, "Missing the required parameter 'field_key' when calling ItemSearchApi.item_search_field_get" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'exact_match'] && !allowable_values.include?(opts[:'exact_match']) fail ArgumentError, "invalid value for \"exact_match\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'return_item_ids'] && !allowable_values.include?(opts[:'return_item_ids']) fail ArgumentError, "invalid value for \"return_item_ids\", must be one of #{allowable_values}" end # resource path local_var_path = '/itemSearch/field' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'field_type'] = field_type query_params[:'field_key'] = field_key query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'return_item_ids'] = opts[:'return_item_ids'] if !opts[:'return_item_ids'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['applicatoin/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'BaseResponse' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ItemSearchApi#item_search_field_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#item_search_get(term, opts = {}) ⇒ BaseResponse
Perform a search from multiple item types Performs a search from your choice of item types and fields.
136 137 138 139 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 136 def item_search_get(term, opts = {}) data, _status_code, _headers = item_search_get_with_http_info(term, opts) data end |
#item_search_get_with_http_info(term, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Perform a search from multiple item types Performs a search from your choice of item types and fields.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/pipedrive-openapi-client/api/item_search_api.rb', line 153 def item_search_get_with_http_info(term, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ItemSearchApi.item_search_get ...' end # verify the required parameter 'term' is set if @api_client.config.client_side_validation && term.nil? fail ArgumentError, "Missing the required parameter 'term' when calling ItemSearchApi.item_search_get" end allowable_values = ["deal", "person", "organization", "product", "lead", "file", "mail_attachment"] if @api_client.config.client_side_validation && opts[:'item_types'] && !allowable_values.include?(opts[:'item_types']) fail ArgumentError, "invalid value for \"item_types\", must be one of #{allowable_values}" end allowable_values = ["address", "code", "custom_fields", "email", "name", "notes", "organization_name", "person_name", "phone", "title"] if @api_client.config.client_side_validation && opts[:'fields'] && !allowable_values.include?(opts[:'fields']) fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'search_for_related_items'] && !allowable_values.include?(opts[:'search_for_related_items']) fail ArgumentError, "invalid value for \"search_for_related_items\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'exact_match'] && !allowable_values.include?(opts[:'exact_match']) fail ArgumentError, "invalid value for \"exact_match\", must be one of #{allowable_values}" end allowable_values = ["deal.cc_email", "person.picture", "product.price"] if @api_client.config.client_side_validation && opts[:'include_fields'] && !allowable_values.include?(opts[:'include_fields']) fail ArgumentError, "invalid value for \"include_fields\", must be one of #{allowable_values}" end # resource path local_var_path = '/itemSearch' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'item_types'] = opts[:'item_types'] if !opts[:'item_types'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'search_for_related_items'] = opts[:'search_for_related_items'] if !opts[:'search_for_related_items'].nil? query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'include_fields'] = opts[:'include_fields'] if !opts[:'include_fields'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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[:body] # return_type return_type = opts[:return_type] || 'BaseResponse' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ItemSearchApi#item_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |