Class: Hubspot::Cms::Blogs::Authors::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



22
23
24
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 22

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#archive(batch_input_string, opts = {}) ⇒ nil

Archive a batch of Blog Authors Archive the Blog Author objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Blog Author ids.

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

    the optional parameters

Returns:

  • (nil)


30
31
32
33
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 30

def archive(batch_input_string, opts = {})
  archive_with_http_info(batch_input_string, opts)
  nil
end

#archive_0(object_id, opts = {}) ⇒ nil

Delete a Blog Author Delete the Blog Author object identified by the id in the path.

Parameters:

  • object_id (String)

    The Blog Author id.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

  • (nil)


95
96
97
98
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 95

def archive_0(object_id, opts = {})
  archive_0_with_http_info(object_id, opts)
  nil
end

#archive_0_with_http_info(object_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a Blog Author Delete the Blog Author object identified by the id in the path.

Parameters:

  • object_id (String)

    The Blog Author id.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

Returns:

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

    nil, response status code and response headers



106
107
108
109
110
111
112
113
114
115
116
117
118
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
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 106

def archive_0_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.archive_0 ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling DefaultApi.archive_0"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

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

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

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#archive_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_with_http_info(batch_input_string, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Archive a batch of Blog Authors Archive the Blog Author objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Blog Author ids.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
87
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 40

def archive_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.archive ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.archive"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/batch/archive'

  # 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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(batch_input_string) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create(blog_author, opts = {}) ⇒ BlogAuthor

Create a new Blog Author Create a new Blog Author.

Parameters:

  • blog_author (BlogAuthor)

    The JSON representation of a new Blog Author.

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

    the optional parameters

Returns:



159
160
161
162
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 159

def create(blog_author, opts = {})
  data, _status_code, _headers = create_with_http_info(blog_author, opts)
  data
end

#create_0(batch_input_blog_author, opts = {}) ⇒ Object

Create a batch of Blog Authors Create the Blog Author objects detailed in the request body.

Parameters:

  • batch_input_blog_author (BatchInputBlogAuthor)

    The JSON array of new Blog Authors to create.

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

    the optional parameters

Returns:

  • (Object)


223
224
225
226
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 223

def create_0(batch_input_blog_author, opts = {})
  data, _status_code, _headers = create_0_with_http_info(batch_input_blog_author, opts)
  data
end

#create_0_with_http_info(batch_input_blog_author, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create a batch of Blog Authors Create the Blog Author objects detailed in the request body.

Parameters:

  • batch_input_blog_author (BatchInputBlogAuthor)

    The JSON array of new Blog Authors to create.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 233

def create_0_with_http_info(batch_input_blog_author, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.create_0 ...'
  end
  # verify the required parameter 'batch_input_blog_author' is set
  if @api_client.config.client_side_validation && batch_input_blog_author.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_blog_author' when calling DefaultApi.create_0"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/batch/create'

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(batch_input_blog_author) 

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#create_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_with_http_info(blog_author, opts = {}) ⇒ Array<(BlogAuthor, Integer, Hash)>

Create a new Blog Author Create a new Blog Author.

Parameters:

  • blog_author (BlogAuthor)

    The JSON representation of a new Blog Author.

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

    the optional parameters

Returns:

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

    BlogAuthor data, response status code and response headers



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
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 169

def create_with_http_info(blog_author, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.create ...'
  end
  # verify the required parameter 'blog_author' is set
  if @api_client.config.client_side_validation && blog_author.nil?
    fail ArgumentError, "Missing the required parameter 'blog_author' when calling DefaultApi.create"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors'

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(blog_author) 

  # return_type
  return_type = opts[:return_type] || 'BlogAuthor' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_id(object_id, opts = {}) ⇒ BlogAuthor

Retrieve a Blog Author Retrieve the Blog Author object identified by the id in the path.

Parameters:

  • object_id (String)

    The Blog Author id.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:



288
289
290
291
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 288

def get_by_id(object_id, opts = {})
  data, _status_code, _headers = get_by_id_with_http_info(object_id, opts)
  data
end

#get_by_id_with_http_info(object_id, opts = {}) ⇒ Array<(BlogAuthor, Integer, Hash)>

Retrieve a Blog Author Retrieve the Blog Author object identified by the id in the path.

Parameters:

  • object_id (String)

    The Blog Author id.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

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

    BlogAuthor data, response status code and response headers



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 299

def get_by_id_with_http_info(object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_by_id ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling DefaultApi.get_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].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] || 'BlogAuthor' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_page(opts = {}) ⇒ CollectionResponseWithTotalBlogAuthorForwardPaging

Get all Blog Authors Get the list of blog authors. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :created_at (DateTime)

    Only return Blog Authors created at exactly the specified time.

  • :created_after (DateTime)

    Only return Blog Authors created after the specified time.

  • :created_before (DateTime)

    Only return Blog Authors created before the specified time.

  • :updated_at (DateTime)

    Only return Blog Authors last updated at exactly the specified time.

  • :updated_after (DateTime)

    Only return Blog Authors last updated after the specified time.

  • :updated_before (DateTime)

    Only return Blog Authors last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:



361
362
363
364
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 361

def get_page(opts = {})
  data, _status_code, _headers = get_page_with_http_info(opts)
  data
end

#get_page_with_http_info(opts = {}) ⇒ Array<(CollectionResponseWithTotalBlogAuthorForwardPaging, Integer, Hash)>

Get all Blog Authors Get the list of blog authors. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :created_at (DateTime)

    Only return Blog Authors created at exactly the specified time.

  • :created_after (DateTime)

    Only return Blog Authors created after the specified time.

  • :created_before (DateTime)

    Only return Blog Authors created before the specified time.

  • :updated_at (DateTime)

    Only return Blog Authors last updated at exactly the specified time.

  • :updated_after (DateTime)

    Only return Blog Authors last updated after the specified time.

  • :updated_before (DateTime)

    Only return Blog Authors last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is 100.

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 380

def get_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_page ...'
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
  query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
  query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
  query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].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] || 'CollectionResponseWithTotalBlogAuthorForwardPaging' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read(batch_input_string, opts = {}) ⇒ Object

Retrieve a batch of Blog Authors Retrieve the Blog Author objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Blog Author ids.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

  • (Object)


439
440
441
442
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 439

def read(batch_input_string, opts = {})
  data, _status_code, _headers = read_with_http_info(batch_input_string, opts)
  data
end

#read_with_http_info(batch_input_string, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Retrieve a batch of Blog Authors Retrieve the Blog Author objects identified in the request body.

Parameters:

  • batch_input_string (BatchInputString)

    The JSON array of Blog Author ids.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to return archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

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

    Object data, response status code and response headers



450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 450

def read_with_http_info(batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.read ...'
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.read"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/batch/read'

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

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(batch_input_string) 

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(batch_input_json_node, opts = {}) ⇒ Object

Update a batch of Blog Authors Update the Blog Author objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)

    A JSON array of the JSON representations of the updated Blog Authors.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

  • (Object)


506
507
508
509
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 506

def update(batch_input_json_node, opts = {})
  data, _status_code, _headers = update_with_http_info(batch_input_json_node, opts)
  data
end

#update_0(object_id, blog_author, opts = {}) ⇒ BlogAuthor

Update a Blog Author Sparse updates a single Blog Author object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified.

Parameters:

  • object_id (String)

    The Blog Author id.

  • blog_author (BlogAuthor)

    The JSON representation of the updated Blog Author.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:



574
575
576
577
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 574

def update_0(object_id, blog_author, opts = {})
  data, _status_code, _headers = update_0_with_http_info(object_id, blog_author, opts)
  data
end

#update_0_with_http_info(object_id, blog_author, opts = {}) ⇒ Array<(BlogAuthor, Integer, Hash)>

Update a Blog Author Sparse updates a single Blog Author object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified.

Parameters:

  • object_id (String)

    The Blog Author id.

  • blog_author (BlogAuthor)

    The JSON representation of the updated Blog Author.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

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

    BlogAuthor data, response status code and response headers



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 586

def update_0_with_http_info(object_id, blog_author, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update_0 ...'
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling DefaultApi.update_0"
  end
  # verify the required parameter 'blog_author' is set
  if @api_client.config.client_side_validation && blog_author.nil?
    fail ArgumentError, "Missing the required parameter 'blog_author' when calling DefaultApi.update_0"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

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

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(blog_author) 

  # return_type
  return_type = opts[:return_type] || 'BlogAuthor' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#update_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_with_http_info(batch_input_json_node, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update a batch of Blog Authors Update the Blog Author objects identified in the request body.

Parameters:

  • batch_input_json_node (BatchInputJsonNode)

    A JSON array of the JSON representations of the updated Blog Authors.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Specifies whether to update archived Blog Authors. Defaults to &#x60;false&#x60;.

Returns:

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

    Object data, response status code and response headers



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb', line 517

def update_with_http_info(batch_input_json_node, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update ...'
  end
  # verify the required parameter 'batch_input_json_node' is set
  if @api_client.config.client_side_validation && batch_input_json_node.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_json_node' when calling DefaultApi.update"
  end
  # resource path
  local_var_path = '/cms/v3/blogs/authors/batch/update'

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

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(batch_input_json_node) 

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end