Class: Azure::ARM::Graph::Applications

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_graph/applications.rb

Overview

Composite Swagger for GraphRbac Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Applications

Creates and initializes a new instance of the Applications class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientGraphRbacManagementClient (readonly)

Returns reference to the GraphRbacManagementClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 23

def client
  @client
end

Instance Method Details

#create(parameters, custom_headers = nil) ⇒ Application

Create a new application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

application. will be added to the HTTP request.

Parameters:

  • parameters (ApplicationCreateParameters)

    Parameters to create an

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



36
37
38
39
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 36

def create(parameters, custom_headers = nil)
  response = create_async(parameters, custom_headers).value!
  response.body unless response.nil?
end

#create_async(parameters, custom_headers = nil) ⇒ Concurrent::Promise

Create a new application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

application. to the HTTP request.

Parameters:

  • parameters (ApplicationCreateParameters)

    Parameters to create an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 67

def create_async(parameters, custom_headers = nil)
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = ApplicationCreateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/{tenantID}/applications'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Application.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_with_http_info(parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Create a new application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

application. will be added to the HTTP request.

Parameters:

  • parameters (ApplicationCreateParameters)

    Parameters to create an

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



52
53
54
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 52

def create_with_http_info(parameters, custom_headers = nil)
  create_async(parameters, custom_headers).value!
end

#delete(application_object_id, custom_headers = nil) ⇒ Object

Delete an application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



231
232
233
234
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 231

def delete(application_object_id, custom_headers = nil)
  response = delete_async(application_object_id, custom_headers).value!
  nil
end

#delete_async(application_object_id, custom_headers = nil) ⇒ Concurrent::Promise

Delete an application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



260
261
262
263
264
265
266
267
268
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
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 260

def delete_async(application_object_id, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/{tenantID}/applications/{applicationObjectId}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(application_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Delete an application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



246
247
248
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 246

def delete_with_http_info(application_object_id, custom_headers = nil)
  delete_async(application_object_id, custom_headers).value!
end

#get(application_object_id, custom_headers = nil) ⇒ Application

Get an application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



315
316
317
318
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 315

def get(application_object_id, custom_headers = nil)
  response = get_async(application_object_id, custom_headers).value!
  response.body unless response.nil?
end

#get_async(application_object_id, custom_headers = nil) ⇒ Concurrent::Promise

Get an application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
393
394
395
396
397
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 344

def get_async(application_object_id, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/{tenantID}/applications/{applicationObjectId}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Application.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_with_http_info(application_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get an application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



330
331
332
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 330

def get_with_http_info(application_object_id, custom_headers = nil)
  get_async(application_object_id, custom_headers).value!
end

#list(filter = nil, custom_headers = nil) ⇒ ApplicationListResult

Lists applications by filter parameters. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filters to apply on the operation

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



140
141
142
143
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 140

def list(filter = nil, custom_headers = nil)
  response = list_async(filter, custom_headers).value!
  response.body unless response.nil?
end

#list_async(filter = nil, custom_headers = nil) ⇒ Concurrent::Promise

Lists applications by filter parameters. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filters to apply on the operation

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 169

def list_async(filter = nil, custom_headers = nil)
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/{tenantID}/applications'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      query_params: {'$filter' => filter,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = ApplicationListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_key_credentials(application_object_id, custom_headers = nil) ⇒ KeyCredentialListResult

Get keyCredentials associated with the application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



508
509
510
511
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 508

def list_key_credentials(application_object_id, custom_headers = nil)
  response = list_key_credentials_async(application_object_id, custom_headers).value!
  response.body unless response.nil?
end

#list_key_credentials_async(application_object_id, custom_headers = nil) ⇒ Concurrent::Promise

Get keyCredentials associated with the application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 537

def list_key_credentials_async(application_object_id, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/{tenantID}/applications/{applicationObjectId}/keyCredentials'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = KeyCredentialListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_key_credentials_with_http_info(application_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get keyCredentials associated with the application by object Id. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



523
524
525
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 523

def list_key_credentials_with_http_info(application_object_id, custom_headers = nil)
  list_key_credentials_async(application_object_id, custom_headers).value!
end

#list_password_credentials(application_object_id, custom_headers = nil) ⇒ PasswordCredentialListResult

Gets passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



701
702
703
704
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 701

def list_password_credentials(application_object_id, custom_headers = nil)
  response = list_password_credentials_async(application_object_id, custom_headers).value!
  response.body unless response.nil?
end

#list_password_credentials_async(application_object_id, custom_headers = nil) ⇒ Concurrent::Promise

Gets passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
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
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 730

def list_password_credentials_async(application_object_id, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/{tenantID}/applications/{applicationObjectId}/passwordCredentials'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = PasswordCredentialListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_password_credentials_with_http_info(application_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



716
717
718
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 716

def list_password_credentials_with_http_info(application_object_id, custom_headers = nil)
  list_password_credentials_async(application_object_id, custom_headers).value!
end

#list_with_http_info(filter = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists applications by filter parameters. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The filters to apply on the operation

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



155
156
157
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 155

def list_with_http_info(filter = nil, custom_headers = nil)
  list_async(filter, custom_headers).value!
end

#patch(application_object_id, parameters, custom_headers = nil) ⇒ Object

Update existing application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (ApplicationUpdateParameters)

    Parameters to update an

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



410
411
412
413
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 410

def patch(application_object_id, parameters, custom_headers = nil)
  response = patch_async(application_object_id, parameters, custom_headers).value!
  nil
end

#patch_async(application_object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Update existing application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

existing application. to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (ApplicationUpdateParameters)

    Parameters to update an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



443
444
445
446
447
448
449
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
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 443

def patch_async(application_object_id, parameters, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = ApplicationUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/{tenantID}/applications/{applicationObjectId}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#patch_with_http_info(application_object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Update existing application. Reference: msdn.microsoft.com/en-us/library/azure/hh974476.aspx

existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (ApplicationUpdateParameters)

    Parameters to update an

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



427
428
429
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 427

def patch_with_http_info(application_object_id, parameters, custom_headers = nil)
  patch_async(application_object_id, parameters, custom_headers).value!
end

#update_key_credentials(application_object_id, parameters, custom_headers = nil) ⇒ Object

Update keyCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

keyCredentials of an existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (KeyCredentialsUpdateParameters)

    Parameters to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



603
604
605
606
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 603

def update_key_credentials(application_object_id, parameters, custom_headers = nil)
  response = update_key_credentials_async(application_object_id, parameters, custom_headers).value!
  nil
end

#update_key_credentials_async(application_object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Update keyCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

keyCredentials of an existing application. to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (KeyCredentialsUpdateParameters)

    Parameters to update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
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
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 636

def update_key_credentials_async(application_object_id, parameters, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = KeyCredentialsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/{tenantID}/applications/{applicationObjectId}/keyCredentials'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#update_key_credentials_with_http_info(application_object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Update keyCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#keycredential-type

keyCredentials of an existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (KeyCredentialsUpdateParameters)

    Parameters to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



620
621
622
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 620

def update_key_credentials_with_http_info(application_object_id, parameters, custom_headers = nil)
  update_key_credentials_async(application_object_id, parameters, custom_headers).value!
end

#update_password_credentials(application_object_id, parameters, custom_headers = nil) ⇒ Object

Updates passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

passwordCredentials of an existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (PasswordCredentialsUpdateParameters)

    Parameters to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



797
798
799
800
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 797

def update_password_credentials(application_object_id, parameters, custom_headers = nil)
  response = update_password_credentials_async(application_object_id, parameters, custom_headers).value!
  nil
end

#update_password_credentials_async(application_object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Updates passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

passwordCredentials of an existing application. to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (PasswordCredentialsUpdateParameters)

    Parameters to update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 832

def update_password_credentials_async(application_object_id, parameters, custom_headers = nil)
  fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  api_version = '1.6'
  fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = PasswordCredentialsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/{tenantID}/applications/{applicationObjectId}/passwordCredentials'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'tenantID' => @client.tenant_id},
      skip_encoding_path_params: {'applicationObjectId' => application_object_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#update_password_credentials_with_http_info(application_object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates passwordCredentials associated with an existing application. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#passwordcredential-type

passwordCredentials of an existing application. will be added to the HTTP request.

Parameters:

  • application_object_id (String)

    Application object id

  • parameters (PasswordCredentialsUpdateParameters)

    Parameters to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



815
816
817
# File 'lib/generated/azure_mgmt_graph/applications.rb', line 815

def update_password_credentials_with_http_info(application_object_id, parameters, custom_headers = nil)
  update_password_credentials_async(application_object_id, parameters, custom_headers).value!
end