Class: Azure::Support::Mgmt::V2020_04_01::SupportTickets

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb

Overview

Microsoft Azure Support Resource Provider.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SupportTickets

Creates and initializes a new instance of the SupportTickets class.



17
18
19
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientMicrosoftSupport (readonly)



22
23
24
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create(support_ticket_name, create_support_ticket_parameters, custom_headers: nil) ⇒ SupportTicketDetails

Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include x-ms-authorization-auxiliary header to provide an auxiliary token as per [documentation](docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.

request payload. will be added to the HTTP request.



579
580
581
582
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 579

def begin_create(support_ticket_name, create_support_ticket_parameters, custom_headers:nil)
  response = begin_create_async(support_ticket_name, create_support_ticket_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(support_ticket_name, create_support_ticket_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include x-ms-authorization-auxiliary header to provide an auxiliary token as per [documentation](docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.

request payload. to the HTTP request.



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
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 652

def begin_create_async(support_ticket_name, create_support_ticket_parameters, custom_headers:nil)
  fail ArgumentError, 'support_ticket_name is nil' if support_ticket_name.nil?
  fail ArgumentError, 'create_support_ticket_parameters is nil' if create_support_ticket_parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketDetails.mapper()
  request_content = @client.serialize(request_mapper,  create_support_ticket_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'supportTicketName' => support_ticket_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketDetails.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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

#begin_create_with_http_info(support_ticket_name, create_support_ticket_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include x-ms-authorization-auxiliary header to provide an auxiliary token as per [documentation](docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.

request payload. will be added to the HTTP request.



616
617
618
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 616

def begin_create_with_http_info(support_ticket_name, create_support_ticket_parameters, custom_headers:nil)
  begin_create_async(support_ticket_name, create_support_ticket_parameters, custom_headers:custom_headers).value!
end

#check_name_availability(check_name_availability_input, custom_headers: nil) ⇒ CheckNameAvailabilityOutput

Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription.

check. will be added to the HTTP request.



36
37
38
39
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 36

def check_name_availability(check_name_availability_input, custom_headers:nil)
  response = check_name_availability_async(check_name_availability_input, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(check_name_availability_input, custom_headers: nil) ⇒ Concurrent::Promise

Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription.

check. to the HTTP request.



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/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 69

def check_name_availability_async(check_name_availability_input, custom_headers:nil)
  fail ArgumentError, 'check_name_availability_input is nil' if check_name_availability_input.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Support::Mgmt::V2020_04_01::Models::CheckNameAvailabilityInput.mapper()
  request_content = @client.serialize(request_mapper,  check_name_availability_input)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::CheckNameAvailabilityOutput.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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

#check_name_availability_with_http_info(check_name_availability_input, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Check the availability of a resource name. This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription.

check. will be added to the HTTP request.



53
54
55
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 53

def check_name_availability_with_http_info(check_name_availability_input, custom_headers:nil)
  check_name_availability_async(check_name_availability_input, custom_headers:custom_headers).value!
end

#create(support_ticket_name, create_support_ticket_parameters, custom_headers: nil) ⇒ SupportTicketDetails

Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include x-ms-authorization-auxiliary header to provide an auxiliary token as per [documentation](docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.

request payload. will be added to the HTTP request.



514
515
516
517
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 514

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

#create_async(support_ticket_name, create_support_ticket_parameters, custom_headers: nil) ⇒ Concurrent::Promise

request payload. will be added to the HTTP request.

response.



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 529

def create_async(support_ticket_name, create_support_ticket_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_async(support_ticket_name, create_support_ticket_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketDetails.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(support_ticket_name, custom_headers: nil) ⇒ SupportTicketDetails

Get ticket details for an Azure subscription. Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

will be added to the HTTP request.



269
270
271
272
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 269

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

#get_async(support_ticket_name, custom_headers: nil) ⇒ Concurrent::Promise

Get ticket details for an Azure subscription. Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

to the HTTP request.



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 300

def get_async(support_ticket_name, custom_headers:nil)
  fail ArgumentError, 'support_ticket_name is nil' if support_ticket_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'supportTicketName' => support_ticket_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketDetails.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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(support_ticket_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get ticket details for an Azure subscription. Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

will be added to the HTTP request.



285
286
287
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 285

def get_with_http_info(support_ticket_name, custom_headers:nil)
  get_async(support_ticket_name, custom_headers:custom_headers).value!
end

#list(top: nil, filter: nil, custom_headers: nil) ⇒ Array<SupportTicketDetails>

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

Default is 25 and max is 100. ‘odata v4.0’ filter semantics. [Learn more](docs.microsoft.com/odata/concepts/queryoptions-overview). Status filter can only be used with Equals (‘eq’) operator. For CreatedDate filter, the supported operators are Greater Than (‘gt’) and Greater Than or Equals (‘ge’). When using both filters, combine them using the logical ‘AND’. will be added to the HTTP request.



152
153
154
155
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 152

def list(top:nil, filter:nil, custom_headers:nil)
  first_page = list_as_lazy(top:top, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(top: nil, filter: nil, custom_headers: nil) ⇒ SupportTicketsListResult

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

Default is 25 and max is 100. ‘odata v4.0’ filter semantics. [Learn more](docs.microsoft.com/odata/concepts/queryoptions-overview). Status filter can only be used with Equals (‘eq’) operator. For CreatedDate filter, the supported operators are Greater Than (‘gt’) and Greater Than or Equals (‘ge’). When using both filters, combine them using the logical ‘AND’. will be added to the HTTP request.

response.



842
843
844
845
846
847
848
849
850
851
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 842

def list_as_lazy(top:nil, filter:nil, custom_headers:nil)
  response = list_async(top:top, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

Default is 25 and max is 100. ‘odata v4.0’ filter semantics. [Learn more](docs.microsoft.com/odata/concepts/queryoptions-overview). Status filter can only be used with Equals (‘eq’) operator. For CreatedDate filter, the supported operators are Greater Than (‘gt’) and Greater Than or Equals (‘ge’). When using both filters, combine them using the logical ‘AND’. to the HTTP request.



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
251
252
253
254
255
256
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 205

def list_async(top:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'$top' => top,'$filter' => filter,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_next(next_page_link, custom_headers: nil) ⇒ SupportTicketsListResult

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

to List operation. will be added to the HTTP request.



729
730
731
732
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 729

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

to List operation. to the HTTP request.



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
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 768

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

to List operation. will be added to the HTTP request.



749
750
751
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 749

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Lists all the support tickets for an Azure subscription. You can also filter the support tickets by Status or CreatedDate using the $filter parameter. Output will be a paged result with nextLink, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error.

Default is 25 and max is 100. ‘odata v4.0’ filter semantics. [Learn more](docs.microsoft.com/odata/concepts/queryoptions-overview). Status filter can only be used with Equals (‘eq’) operator. For CreatedDate filter, the supported operators are Greater Than (‘gt’) and Greater Than or Equals (‘ge’). When using both filters, combine them using the logical ‘AND’. will be added to the HTTP request.



179
180
181
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 179

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

#update(support_ticket_name, update_support_ticket, custom_headers: nil) ⇒ SupportTicketDetails

This API allows you to update the severity level, ticket status, and your contact information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.<br/><br/>Changing the ticket status to closed is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer.

object. will be added to the HTTP request.



373
374
375
376
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 373

def update(support_ticket_name, update_support_ticket, custom_headers:nil)
  response = update_async(support_ticket_name, update_support_ticket, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(support_ticket_name, update_support_ticket, custom_headers: nil) ⇒ Concurrent::Promise

This API allows you to update the severity level, ticket status, and your contact information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.<br/><br/>Changing the ticket status to closed is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer.

object. to the HTTP request.



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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 420

def update_async(support_ticket_name, update_support_ticket, custom_headers:nil)
  fail ArgumentError, 'support_ticket_name is nil' if support_ticket_name.nil?
  fail ArgumentError, 'update_support_ticket is nil' if update_support_ticket.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Support::Mgmt::V2020_04_01::Models::UpdateSupportTicket.mapper()
  request_content = @client.serialize(request_mapper,  update_support_ticket)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'supportTicketName' => support_ticket_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Support::Mgmt::V2020_04_01::Models::SupportTicketDetails.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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

#update_with_http_info(support_ticket_name, update_support_ticket, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This API allows you to update the severity level, ticket status, and your contact information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.<br/><br/>Changing the ticket status to closed is allowed only on an unassigned case. When an engineer is actively working on the ticket, send your ticket closure request by sending a note to your engineer.

object. will be added to the HTTP request.



397
398
399
# File 'lib/2020-04-01/generated/azure_mgmt_support/support_tickets.rb', line 397

def update_with_http_info(support_ticket_name, update_support_ticket, custom_headers:nil)
  update_async(support_ticket_name, update_support_ticket, custom_headers:custom_headers).value!
end