Class: IbmCloudIam::TrustedProfileTemplateApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm_cloud_iam/api/trusted_profile_template_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TrustedProfileTemplateApi

Returns a new instance of TrustedProfileTemplateApi.



19
20
21
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_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/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#commit_profile_template(template_id, version, authorization, opts = {}) ⇒ nil

Commit a template version Commit a specific version of a trusted profile template in an enterprise account. You must commit a template before you can assign it to child accounts. Once a template is committed, you can no longer modify the template.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 29

def commit_profile_template(template_id, version, authorization, opts = {})
  commit_profile_template_with_http_info(template_id, version, authorization, opts)
  nil
end

#commit_profile_template_with_http_info(template_id, version, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Commit a template version Commit a specific version of a trusted profile template in an enterprise account. You must commit a template before you can assign it to child accounts. Once a template is committed, you can no longer modify the template.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
88
89
90
91
92
93
94
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 41

def commit_profile_template_with_http_info(template_id, version, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.commit_profile_template ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.commit_profile_template"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling TrustedProfileTemplateApi.commit_profile_template"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.commit_profile_template"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions/{version}/commit'.sub('{template_id}', CGI.escape(template_id.to_s)).sub('{version}', CGI.escape(version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.commit_profile_template",
    :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: TrustedProfileTemplateApi#commit_profile_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_profile_template(authorization, trusted_profile_template_request, opts = {}) ⇒ TrustedProfileTemplateResponse

Create a trusted profile template Create a new trusted profile template in an enterprise account.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create a trusted profile template.

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

    the optional parameters

Returns:



102
103
104
105
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 102

def create_profile_template(authorization, trusted_profile_template_request, opts = {})
  data, _status_code, _headers = create_profile_template_with_http_info(authorization, trusted_profile_template_request, opts)
  data
end

#create_profile_template_version(template_id, authorization, trusted_profile_template_request, opts = {}) ⇒ TrustedProfileTemplateResponse

Create new version of a trusted profile template Create a new version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create new version of a Trusted Profile Template

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

    the optional parameters

Returns:



178
179
180
181
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 178

def create_profile_template_version(template_id, authorization, trusted_profile_template_request, opts = {})
  data, _status_code, _headers = create_profile_template_version_with_http_info(template_id, authorization, trusted_profile_template_request, opts)
  data
end

#create_profile_template_version_with_http_info(template_id, authorization, trusted_profile_template_request, opts = {}) ⇒ Array<(TrustedProfileTemplateResponse, Integer, Hash)>

Create new version of a trusted profile template Create a new version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create new version of a Trusted Profile Template

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

    the optional parameters

Returns:



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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 190

def create_profile_template_version_with_http_info(template_id, authorization, trusted_profile_template_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.create_profile_template_version ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.create_profile_template_version"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.create_profile_template_version"
  end
  # verify the required parameter 'trusted_profile_template_request' is set
  if @api_client.config.client_side_validation && trusted_profile_template_request.nil?
    fail ArgumentError, "Missing the required parameter 'trusted_profile_template_request' when calling TrustedProfileTemplateApi.create_profile_template_version"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions'.sub('{template_id}', CGI.escape(template_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']) unless header_params['Accept']
  # 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
  header_params[:'Authorization'] = authorization

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.create_profile_template_version",
    :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: TrustedProfileTemplateApi#create_profile_template_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_profile_template_with_http_info(authorization, trusted_profile_template_request, opts = {}) ⇒ Array<(TrustedProfileTemplateResponse, Integer, Hash)>

Create a trusted profile template Create a new trusted profile template in an enterprise account.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create a trusted profile template.

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

    the optional parameters

Returns:



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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 113

def create_profile_template_with_http_info(authorization, trusted_profile_template_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.create_profile_template ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.create_profile_template"
  end
  # verify the required parameter 'trusted_profile_template_request' is set
  if @api_client.config.client_side_validation && trusted_profile_template_request.nil?
    fail ArgumentError, "Missing the required parameter 'trusted_profile_template_request' when calling TrustedProfileTemplateApi.create_profile_template"
  end
  # resource path
  local_var_path = '/v1/profile_templates'

  # 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']) unless header_params['Accept']
  # 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
  header_params[:'Authorization'] = authorization

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.create_profile_template",
    :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: TrustedProfileTemplateApi#create_profile_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_all_versions_of_profile_template(template_id, authorization, opts = {}) ⇒ nil

Delete all versions of a trusted profile template Delete all versions of a trusted profile template in an enterprise account. If any version is assigned to child accounts, you must first delete the assignment.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


258
259
260
261
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 258

def delete_all_versions_of_profile_template(template_id, authorization, opts = {})
  delete_all_versions_of_profile_template_with_http_info(template_id, authorization, opts)
  nil
end

#delete_all_versions_of_profile_template_with_http_info(template_id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete all versions of a trusted profile template Delete all versions of a trusted profile template in an enterprise account. If any version is assigned to child accounts, you must first delete the assignment.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 269

def delete_all_versions_of_profile_template_with_http_info(template_id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.delete_all_versions_of_profile_template ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.delete_all_versions_of_profile_template"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.delete_all_versions_of_profile_template"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.delete_all_versions_of_profile_template",
    :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: TrustedProfileTemplateApi#delete_all_versions_of_profile_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_profile_template_version(template_id, version, authorization, opts = {}) ⇒ nil

Delete version of trusted profile template Delete a specific version of a trusted profile template in an enterprise account. If the version is assigned to child accounts, you must first delete the assignment.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


327
328
329
330
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 327

def delete_profile_template_version(template_id, version, authorization, opts = {})
  delete_profile_template_version_with_http_info(template_id, version, authorization, opts)
  nil
end

#delete_profile_template_version_with_http_info(template_id, version, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete version of trusted profile template Delete a specific version of a trusted profile template in an enterprise account. If the version is assigned to child accounts, you must first delete the assignment.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 339

def delete_profile_template_version_with_http_info(template_id, version, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.delete_profile_template_version ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.delete_profile_template_version"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling TrustedProfileTemplateApi.delete_profile_template_version"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.delete_profile_template_version"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions/{version}'.sub('{template_id}', CGI.escape(template_id.to_s)).sub('{version}', CGI.escape(version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.delete_profile_template_version",
    :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: TrustedProfileTemplateApi#delete_profile_template_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_latest_profile_template_version(template_id, authorization, opts = {}) ⇒ TrustedProfileTemplateResponse

Get latest version of a trusted profile template Get the latest version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response (default to false)

Returns:



401
402
403
404
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 401

def get_latest_profile_template_version(template_id, authorization, opts = {})
  data, _status_code, _headers = get_latest_profile_template_version_with_http_info(template_id, authorization, opts)
  data
end

#get_latest_profile_template_version_with_http_info(template_id, authorization, opts = {}) ⇒ Array<(TrustedProfileTemplateResponse, Integer, Hash)>

Get latest version of a trusted profile template Get the latest version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response (default to false)

Returns:



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 413

def get_latest_profile_template_version_with_http_info(template_id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.get_latest_profile_template_version ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.get_latest_profile_template_version"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.get_latest_profile_template_version"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s))

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

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.get_latest_profile_template_version",
    :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: TrustedProfileTemplateApi#get_latest_profile_template_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profile_template_version(template_id, version, authorization, opts = {}) ⇒ TrustedProfileTemplateResponse

Get version of trusted profile template Get a specific version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response (default to false)

Returns:



475
476
477
478
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 475

def get_profile_template_version(template_id, version, authorization, opts = {})
  data, _status_code, _headers = get_profile_template_version_with_http_info(template_id, version, authorization, opts)
  data
end

#get_profile_template_version_with_http_info(template_id, version, authorization, opts = {}) ⇒ Array<(TrustedProfileTemplateResponse, Integer, Hash)>

Get version of trusted profile template Get a specific version of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response (default to false)

Returns:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
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
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 488

def get_profile_template_version_with_http_info(template_id, version, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.get_profile_template_version ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.get_profile_template_version"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling TrustedProfileTemplateApi.get_profile_template_version"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.get_profile_template_version"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions/{version}'.sub('{template_id}', CGI.escape(template_id.to_s)).sub('{version}', CGI.escape(version.to_s))

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

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.get_profile_template_version",
    :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: TrustedProfileTemplateApi#get_profile_template_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_profile_templates(authorization, opts = {}) ⇒ TrustedProfileTemplateList

List trusted profile templates List the trusted profile templates in an enterprise account.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the trusted profile templates to query. This parameter is required unless using a pagetoken.

  • :limit (String)

    Optional size of a single page. (default to '20')

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property. If specified, the returned templates are sorted according to this property. (default to 'created_at')

  • :order (String)

    Optional sort order. (default to 'asc')

  • :include_history (String)

    Defines if the entity history is included in the response. (default to 'false')

Returns:



557
558
559
560
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 557

def list_profile_templates(authorization, opts = {})
  data, _status_code, _headers = list_profile_templates_with_http_info(authorization, opts)
  data
end

#list_profile_templates_with_http_info(authorization, opts = {}) ⇒ Array<(TrustedProfileTemplateList, Integer, Hash)>

List trusted profile templates List the trusted profile templates in an enterprise account.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the trusted profile templates to query. This parameter is required unless using a pagetoken.

  • :limit (String)

    Optional size of a single page. (default to '20')

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property. If specified, the returned templates are sorted according to this property. (default to 'created_at')

  • :order (String)

    Optional sort order. (default to 'asc')

  • :include_history (String)

    Defines if the entity history is included in the response. (default to 'false')

Returns:

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

    TrustedProfileTemplateList data, response status code and response headers



573
574
575
576
577
578
579
580
581
582
583
584
585
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
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 573

def list_profile_templates_with_http_info(authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.list_profile_templates ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.list_profile_templates"
  end
  allowable_values = ["created_at", "last_modified_at", "name"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/profile_templates'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.list_profile_templates",
    :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: TrustedProfileTemplateApi#list_profile_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_versions_of_profile_template(template_id, authorization, opts = {}) ⇒ TrustedProfileTemplateList

List trusted profile template versions List the versions of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :limit (String)

    Optional size of a single page. (default to '20')

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property. If specified, the returned templated are sorted according to this property (default to 'created_at')

  • :order (String)

    Optional sort order. (default to 'asc')

  • :include_history (String)

    Defines if the entity history is included in the response (default to 'false')

Returns:



647
648
649
650
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 647

def list_versions_of_profile_template(template_id, authorization, opts = {})
  data, _status_code, _headers = list_versions_of_profile_template_with_http_info(template_id, authorization, opts)
  data
end

#list_versions_of_profile_template_with_http_info(template_id, authorization, opts = {}) ⇒ Array<(TrustedProfileTemplateList, Integer, Hash)>

List trusted profile template versions List the versions of a trusted profile template in an enterprise account.

Parameters:

  • template_id (String)

    ID of the trusted profile template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :limit (String)

    Optional size of a single page. (default to '20')

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property. If specified, the returned templated are sorted according to this property (default to 'created_at')

  • :order (String)

    Optional sort order. (default to 'asc')

  • :include_history (String)

    Defines if the entity history is included in the response (default to 'false')

Returns:

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

    TrustedProfileTemplateList data, response status code and response headers



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 663

def list_versions_of_profile_template_with_http_info(template_id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.list_versions_of_profile_template ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.list_versions_of_profile_template"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.list_versions_of_profile_template"
  end
  allowable_values = ["created_at", "last_modified_at", "name"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions'.sub('{template_id}', CGI.escape(template_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"TrustedProfileTemplateApi.list_versions_of_profile_template",
    :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: TrustedProfileTemplateApi#list_versions_of_profile_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_profile_template_version(if_match, template_id, version, authorization, trusted_profile_template_request, opts = {}) ⇒ TrustedProfileTemplateResponse

Update version of trusted profile template Update a specific version of a trusted profile template in an enterprise account.

Parameters:

  • if_match (String)

    Entity tag of the Template to be updated. Specify the tag that you retrieved when reading the Profile Template. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create a trusted profile template.

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

    the optional parameters

Returns:



738
739
740
741
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 738

def update_profile_template_version(if_match, template_id, version, authorization, trusted_profile_template_request, opts = {})
  data, _status_code, _headers = update_profile_template_version_with_http_info(if_match, template_id, version, authorization, trusted_profile_template_request, opts)
  data
end

#update_profile_template_version_with_http_info(if_match, template_id, version, authorization, trusted_profile_template_request, opts = {}) ⇒ Array<(TrustedProfileTemplateResponse, Integer, Hash)>

Update version of trusted profile template Update a specific version of a trusted profile template in an enterprise account.

Parameters:

  • if_match (String)

    Entity tag of the Template to be updated. Specify the tag that you retrieved when reading the Profile Template. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • template_id (String)

    ID of the trusted profile template

  • version (String)

    Version of the Profile Template

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • trusted_profile_template_request (TrustedProfileTemplateRequest)

    Request to create a trusted profile template.

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

    the optional parameters

Returns:



752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File 'lib/ibm_cloud_iam/api/trusted_profile_template_api.rb', line 752

def update_profile_template_version_with_http_info(if_match, template_id, version, authorization, trusted_profile_template_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TrustedProfileTemplateApi.update_profile_template_version ...'
  end
  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling TrustedProfileTemplateApi.update_profile_template_version"
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling TrustedProfileTemplateApi.update_profile_template_version"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling TrustedProfileTemplateApi.update_profile_template_version"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling TrustedProfileTemplateApi.update_profile_template_version"
  end
  # verify the required parameter 'trusted_profile_template_request' is set
  if @api_client.config.client_side_validation && trusted_profile_template_request.nil?
    fail ArgumentError, "Missing the required parameter 'trusted_profile_template_request' when calling TrustedProfileTemplateApi.update_profile_template_version"
  end
  # resource path
  local_var_path = '/v1/profile_templates/{template_id}/versions/{version}'.sub('{template_id}', CGI.escape(template_id.to_s)).sub('{version}', CGI.escape(version.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']) unless header_params['Accept']
  # 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
  header_params[:'If-Match'] = if_match
  header_params[:'Authorization'] = authorization

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || []

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