lib/hubspot/codegen/crm/objects/meetings/api/associations_api.rb in hubspot-api-client-16.0.3 vs lib/hubspot/codegen/crm/objects/meetings/api/associations_api.rb in hubspot-api-client-16.0.4
- old
+ new
@@ -20,30 +20,30 @@
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
- # Remove an association between two meetings
- # @param meeting_id [String]
+ # Delete
+ # deletes all associations between two records.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
- # @param to_object_id [String]
- # @param association_type [String]
+ # @param to_object_id [Integer]
# @param [Hash] opts the optional parameters
# @return [nil]
- def archive(meeting_id, to_object_type, to_object_id, association_type, opts = {})
- archive_with_http_info(meeting_id, to_object_type, to_object_id, association_type, opts)
+ def archive(meeting_id, to_object_type, to_object_id, opts = {})
+ archive_with_http_info(meeting_id, to_object_type, to_object_id, opts)
nil
end
- # Remove an association between two meetings
- # @param meeting_id [String]
+ # Delete
+ # deletes all associations between two records.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
- # @param to_object_id [String]
- # @param association_type [String]
+ # @param to_object_id [Integer]
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
- def archive_with_http_info(meeting_id, to_object_type, to_object_id, association_type, opts = {})
+ def archive_with_http_info(meeting_id, to_object_type, to_object_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AssociationsApi.archive ...'
end
# verify the required parameter 'meeting_id' is set
if @api_client.config.client_side_validation && meeting_id.nil?
@@ -55,16 +55,12 @@
end
# verify the required parameter 'to_object_id' is set
if @api_client.config.client_side_validation && to_object_id.nil?
fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.archive"
end
- # verify the required parameter 'association_type' is set
- if @api_client.config.client_side_validation && association_type.nil?
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.archive"
- end
# resource path
- local_var_path = '/crm/v4/objects/meetings/{meetingId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'meetingId' + '}', CGI.escape(meeting_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
+ local_var_path = '/crm/v4/objects/meetings/{meetingId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'meetingId' + '}', CGI.escape(meeting_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
@@ -99,30 +95,32 @@
@api_client.config.logger.debug "API called: AssociationsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
- # Associate a meeting with another object
- # @param meeting_id [String]
+ # Create
+ # Set association labels between two records.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
- # @param to_object_id [String]
- # @param association_type [String]
+ # @param to_object_id [Integer]
+ # @param association_spec [Array<AssociationSpec>]
# @param [Hash] opts the optional parameters
- # @return [SimplePublicObjectWithAssociations]
- def create(meeting_id, to_object_type, to_object_id, association_type, opts = {})
- data, _status_code, _headers = create_with_http_info(meeting_id, to_object_type, to_object_id, association_type, opts)
+ # @return [LabelsBetweenObjectPair]
+ def create(meeting_id, to_object_type, to_object_id, association_spec, opts = {})
+ data, _status_code, _headers = create_with_http_info(meeting_id, to_object_type, to_object_id, association_spec, opts)
data
end
- # Associate a meeting with another object
- # @param meeting_id [String]
+ # Create
+ # Set association labels between two records.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
- # @param to_object_id [String]
- # @param association_type [String]
+ # @param to_object_id [Integer]
+ # @param association_spec [Array<AssociationSpec>]
# @param [Hash] opts the optional parameters
- # @return [Array<(SimplePublicObjectWithAssociations, Integer, Hash)>] SimplePublicObjectWithAssociations data, response status code and response headers
- def create_with_http_info(meeting_id, to_object_type, to_object_id, association_type, opts = {})
+ # @return [Array<(LabelsBetweenObjectPair, Integer, Hash)>] LabelsBetweenObjectPair data, response status code and response headers
+ def create_with_http_info(meeting_id, to_object_type, to_object_id, association_spec, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AssociationsApi.create ...'
end
# verify the required parameter 'meeting_id' is set
if @api_client.config.client_side_validation && meeting_id.nil?
@@ -134,33 +132,38 @@
end
# verify the required parameter 'to_object_id' is set
if @api_client.config.client_side_validation && to_object_id.nil?
fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.create"
end
- # verify the required parameter 'association_type' is set
- if @api_client.config.client_side_validation && association_type.nil?
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.create"
+ # verify the required parameter 'association_spec' is set
+ if @api_client.config.client_side_validation && association_spec.nil?
+ fail ArgumentError, "Missing the required parameter 'association_spec' when calling AssociationsApi.create"
end
# resource path
- local_var_path = '/crm/v4/objects/meetings/{meetingId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'meetingId' + '}', CGI.escape(meeting_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
+ local_var_path = '/crm/v4/objects/meetings/{meetingId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'meetingId' + '}', CGI.escape(meeting_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
- post_body = opts[:debug_body]
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(association_spec)
# return_type
- return_type = opts[:debug_return_type] || 'SimplePublicObjectWithAssociations'
+ return_type = opts[:debug_return_type] || 'LabelsBetweenObjectPair'
# auth_names
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
new_options = opts.merge(
@@ -178,29 +181,31 @@
@api_client.config.logger.debug "API called: AssociationsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
- # List associations of a meeting by type
- # @param meeting_id [String]
+ # List
+ # List all associations of a meeting by object type. Limit 1000 per call.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
# @param [Hash] opts the optional parameters
# @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
# @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
- # @return [CollectionResponseAssociatedIdForwardPaging]
+ # @return [CollectionResponseMultiAssociatedObjectWithLabelForwardPaging]
def get_all(meeting_id, to_object_type, opts = {})
data, _status_code, _headers = get_all_with_http_info(meeting_id, to_object_type, opts)
data
end
- # List associations of a meeting by type
- # @param meeting_id [String]
+ # List
+ # List all associations of a meeting by object type. Limit 1000 per call.
+ # @param meeting_id [Integer]
# @param to_object_type [String]
# @param [Hash] opts the optional parameters
# @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
# @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
- # @return [Array<(CollectionResponseAssociatedIdForwardPaging, Integer, Hash)>] CollectionResponseAssociatedIdForwardPaging data, response status code and response headers
+ # @return [Array<(CollectionResponseMultiAssociatedObjectWithLabelForwardPaging, Integer, Hash)>] CollectionResponseMultiAssociatedObjectWithLabelForwardPaging data, response status code and response headers
def get_all_with_http_info(meeting_id, to_object_type, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AssociationsApi.get_all ...'
end
# verify the required parameter 'meeting_id' is set
@@ -229,10 +234,10 @@
# http body (model)
post_body = opts[:debug_body]
# return_type
- return_type = opts[:debug_return_type] || 'CollectionResponseAssociatedIdForwardPaging'
+ return_type = opts[:debug_return_type] || 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'
# auth_names
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
new_options = opts.merge(