Class: Azure::Web::Mgmt::V2018_02_01::Domains

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-02-01/generated/azure_mgmt_web/domains.rb

Overview

WebSite Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Domains

Creates and initializes a new instance of the Domains class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



22
23
24
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Domain

Creates or updates a domain.

Creates or updates a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (Domain)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (Domain)

    operation results.



1589
1590
1591
1592
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1589

def begin_create_or_update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a domain.

Creates or updates a domain.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (Domain)

    Domain registration information.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1626

def begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil?
  fail ArgumentError, 'domain is nil' if domain.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::Web::Mgmt::V2018_02_01::Models::Domain.mapper()
  request_content = @client.serialize(request_mapper,  domain)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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 == 202 || 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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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_or_update_with_http_info(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a domain.

Creates or updates a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (Domain)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1608
1609
1610
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1608

def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
end

#check_availability(identifier, custom_headers: nil) ⇒ DomainAvailablilityCheckResult

Check if a domain is available for registration.

Check if a domain is available for registration.

will be added to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain.

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

    A hash of custom headers that

Returns:

  • (DomainAvailablilityCheckResult)

    operation results.



35
36
37
38
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 35

def check_availability(identifier, custom_headers:nil)
  response = check_availability_async(identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_availability_async(identifier, custom_headers: nil) ⇒ Concurrent::Promise

Check if a domain is available for registration.

Check if a domain is available for registration.

to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 66

def check_availability_async(identifier, custom_headers:nil)
  fail ArgumentError, 'identifier is nil' if identifier.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::Web::Mgmt::V2018_02_01::Models::NameIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'

  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::Web::Mgmt::V2018_02_01::Models::DomainAvailablilityCheckResult.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_availability_with_http_info(identifier, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Check if a domain is available for registration.

Check if a domain is available for registration.

will be added to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



51
52
53
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 51

def check_availability_with_http_info(identifier, custom_headers:nil)
  check_availability_async(identifier, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Domain

Creates or updates a domain.

Creates or updates a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (Domain)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (Domain)

    operation results.



639
640
641
642
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 639

def create_or_update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (Domain)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 655

def create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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

#create_or_update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ DomainOwnershipIdentifier

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

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

    A hash of custom headers that

Returns:

  • (DomainOwnershipIdentifier)

    operation results.



1139
1140
1141
1142
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1139

def create_or_update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  response = create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ Concurrent::Promise

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1184

def create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  domain_ownership_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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
      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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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

#create_or_update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1162
1163
1164
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1162

def create_or_update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
end

#delete(resource_group_name, domain_name, force_hard_delete_domain: nil, custom_headers: nil) ⇒ Object

Delete a domain.

Delete a domain.

resource belongs. the domain immediately. The default is false which deletes the domain after 24 hours. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • force_hard_delete_domain (Boolean) (defaults to: nil)

    Specify true to delete

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

    A hash of custom headers that



688
689
690
691
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 688

def delete(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  response = delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, domain_name, force_hard_delete_domain: nil, custom_headers: nil) ⇒ Concurrent::Promise

Delete a domain.

Delete a domain.

resource belongs. the domain immediately. The default is false which deletes the domain after 24 hours. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • force_hard_delete_domain (Boolean) (defaults to: nil)

    Specify true to delete

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



729
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 729

def delete_async(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'subscriptionId' => @client.subscription_id},
      query_params: {'forceHardDeleteDomain' => force_hard_delete_domain,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, 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 == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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?

    result
  end

  promise.execute
end

#delete_ownership_identifier(resource_group_name, domain_name, name, custom_headers: nil) ⇒ Object

Delete ownership identifier for domain

Delete ownership identifier for domain

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

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

    A hash of custom headers that



1264
1265
1266
1267
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1264

def delete_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil)
  response = delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
  nil
end

#delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Delete ownership identifier for domain

Delete ownership identifier for domain

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1301

def delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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(:delete, 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 == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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?

    result
  end

  promise.execute
end

#delete_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete ownership identifier for domain

Delete ownership identifier for domain

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1283
1284
1285
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1283

def delete_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil)
  delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
end

#delete_with_http_info(resource_group_name, domain_name, force_hard_delete_domain: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a domain.

Delete a domain.

resource belongs. the domain immediately. The default is false which deletes the domain after 24 hours. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • force_hard_delete_domain (Boolean) (defaults to: nil)

    Specify true to delete

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



709
710
711
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 709

def delete_with_http_info(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value!
end

#get(resource_group_name, domain_name, custom_headers: nil) ⇒ Domain

Get a domain.

Get a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

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

    A hash of custom headers that

Returns:

  • (Domain)

    operation results.



532
533
534
535
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 532

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

#get_async(resource_group_name, domain_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a domain.

Get a domain.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



567
568
569
570
571
572
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 567

def get_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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::Web::Mgmt::V2018_02_01::Models::Domain.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_control_center_sso_request(custom_headers: nil) ⇒ DomainControlCenterSsoRequest

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (DomainControlCenterSsoRequest)

    operation results.



229
230
231
232
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 229

def get_control_center_sso_request(custom_headers:nil)
  response = get_control_center_sso_request_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_control_center_sso_request_async(custom_headers: nil) ⇒ Concurrent::Promise

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



258
259
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
304
305
306
307
308
309
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 258

def get_control_center_sso_request_async(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.DomainRegistration/generateSsoRequest'

  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},
      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::Web::Mgmt::V2018_02_01::Models::DomainControlCenterSsoRequest.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_control_center_sso_request_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



244
245
246
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 244

def get_control_center_sso_request_with_http_info(custom_headers:nil)
  get_control_center_sso_request_async(custom_headers:custom_headers).value!
end

#get_ownership_identifier(resource_group_name, domain_name, name, custom_headers: nil) ⇒ DomainOwnershipIdentifier

Get ownership identifier for domain

Get ownership identifier for domain

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

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

    A hash of custom headers that

Returns:

  • (DomainOwnershipIdentifier)

    operation results.



1025
1026
1027
1028
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1025

def get_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil)
  response = get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Get ownership identifier for domain

Get ownership identifier for domain

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1062

def get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get ownership identifier for domain

Get ownership identifier for domain

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1044
1045
1046
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1044

def get_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil)
  get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, domain_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a domain.

Get a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



550
551
552
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 550

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

#list(custom_headers: nil) ⇒ Array<Domain>

Get all domains in a subscription.

Get all domains in a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<Domain>)

    operation results.



137
138
139
140
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 137

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

#list_as_lazy(custom_headers: nil) ⇒ DomainCollection

Get all domains in a subscription.

Get all domains in a subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (DomainCollection)

    which provide lazy access to pages of the



2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2098

def list_as_lazy(custom_headers:nil)
  response = list_async(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(custom_headers: nil) ⇒ Concurrent::Promise

Get all domains in a subscription.

Get all domains in a subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



166
167
168
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 166

def list_async(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.DomainRegistration/domains'

  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},
      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::Web::Mgmt::V2018_02_01::Models::DomainCollection.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_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<Domain>

Get all domains in a resource group.

Get all domains in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (Array<Domain>)

    operation results.



429
430
431
432
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 429

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ DomainCollection

Get all domains in a resource group.

Get all domains in a resource group.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (DomainCollection)

    which provide lazy access to pages of the



2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2146

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all domains in a resource group.

Get all domains in a resource group.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 462

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_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::Web::Mgmt::V2018_02_01::Models::DomainCollection.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_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ DomainCollection

Get all domains in a resource group.

Get all domains in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (DomainCollection)

    operation results.



1907
1908
1909
1910
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1907

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

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

Get all domains in a resource group.

Get all domains in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1940

def list_by_resource_group_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::Web::Mgmt::V2018_02_01::Models::DomainCollection.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_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all domains in a resource group.

Get all domains in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1924
1925
1926
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1924

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all domains in a resource group.

Get all domains in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



446
447
448
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 446

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ DomainCollection

Get all domains in a subscription.

Get all domains in a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (DomainCollection)

    operation results.



1715
1716
1717
1718
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1715

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

Get all domains in a subscription.

Get all domains in a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1748

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::Web::Mgmt::V2018_02_01::Models::DomainCollection.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

Get all domains in a subscription.

Get all domains in a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1732
1733
1734
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1732

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_ownership_identifiers(resource_group_name, domain_name, custom_headers: nil) ⇒ Array<DomainOwnershipIdentifier>

Lists domain ownership identifiers.

Lists domain ownership identifiers.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

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

    A hash of custom headers that

Returns:

  • (Array<DomainOwnershipIdentifier>)

    operation results.



918
919
920
921
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 918

def list_ownership_identifiers(resource_group_name, domain_name, custom_headers:nil)
  first_page = list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers: nil) ⇒ DomainOwnershipIdentifierCollection

Lists domain ownership identifiers.

Lists domain ownership identifiers.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

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

    A hash of custom headers that

Returns:

  • (DomainOwnershipIdentifierCollection)

    which provide lazy access to



2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2171

def list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:nil)
  response = list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists domain ownership identifiers.

Lists domain ownership identifiers.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 953

def list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifierCollection.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_ownership_identifiers_next(next_page_link, custom_headers: nil) ⇒ DomainOwnershipIdentifierCollection

Lists domain ownership identifiers.

Lists domain ownership identifiers.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (DomainOwnershipIdentifierCollection)

    operation results.



2003
2004
2005
2006
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2003

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

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

Lists domain ownership identifiers.

Lists domain ownership identifiers.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2036

def list_ownership_identifiers_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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifierCollection.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_ownership_identifiers_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists domain ownership identifiers.

Lists domain ownership identifiers.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2020
2021
2022
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2020

def list_ownership_identifiers_next_with_http_info(next_page_link, custom_headers:nil)
  list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_ownership_identifiers_with_http_info(resource_group_name, domain_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists domain ownership identifiers.

Lists domain ownership identifiers.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



936
937
938
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 936

def list_ownership_identifiers_with_http_info(resource_group_name, domain_name, custom_headers:nil)
  list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
end

#list_recommendations(parameters, custom_headers: nil) ⇒ Array<NameIdentifier>

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

for domain name recommendations. will be added to the HTTP request.

Parameters:

  • parameters (DomainRecommendationSearchParameters)

    Search parameters

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

    A hash of custom headers that

Returns:

  • (Array<NameIdentifier>)

    operation results.



323
324
325
326
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 323

def list_recommendations(parameters, custom_headers:nil)
  first_page = list_recommendations_as_lazy(parameters, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_recommendations_as_lazy(parameters, custom_headers: nil) ⇒ NameIdentifierCollection

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

for domain name recommendations. will be added to the HTTP request.

response.

Parameters:

  • parameters (DomainRecommendationSearchParameters)

    Search parameters

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

    A hash of custom headers that

Returns:

  • (NameIdentifierCollection)

    which provide lazy access to pages of the



2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 2122

def list_recommendations_as_lazy(parameters, custom_headers:nil)
  response = list_recommendations_async(parameters, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_recommendations_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_recommendations_async(parameters, custom_headers: nil) ⇒ Concurrent::Promise

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

for domain name recommendations. to the HTTP request.

Parameters:

  • parameters (DomainRecommendationSearchParameters)

    Search parameters

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 356

def list_recommendations_async(parameters, custom_headers:nil)
  fail ArgumentError, 'parameters is nil' if 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::Web::Mgmt::V2018_02_01::Models::DomainRecommendationSearchParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'

  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::Web::Mgmt::V2018_02_01::Models::NameIdentifierCollection.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_recommendations_next(next_page_link, custom_headers: nil) ⇒ NameIdentifierCollection

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (NameIdentifierCollection)

    operation results.



1811
1812
1813
1814
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1811

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

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

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1844

def list_recommendations_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(: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::Web::Mgmt::V2018_02_01::Models::NameIdentifierCollection.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_recommendations_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1828
1829
1830
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1828

def list_recommendations_next_with_http_info(next_page_link, custom_headers:nil)
  list_recommendations_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_recommendations_with_http_info(parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

for domain name recommendations. will be added to the HTTP request.

Parameters:

  • parameters (DomainRecommendationSearchParameters)

    Search parameters

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



340
341
342
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 340

def list_recommendations_with_http_info(parameters, custom_headers:nil)
  list_recommendations_async(parameters, custom_headers:custom_headers).value!
end

#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all domains in a subscription.

Get all domains in a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



152
153
154
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 152

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

#renew(resource_group_name, domain_name, custom_headers: nil) ⇒ Object

Renew a domain.

Renew a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

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

    A hash of custom headers that



1492
1493
1494
1495
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1492

def renew(resource_group_name, domain_name, custom_headers:nil)
  response = renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
  nil
end

#renew_async(resource_group_name, domain_name, custom_headers: nil) ⇒ Concurrent::Promise

Renew a domain.

Renew a domain.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1527

def renew_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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(: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 || status_code == 202 || status_code == 204 || status_code == 400 || status_code == 500
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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?

    result
  end

  promise.execute
end

#renew_with_http_info(resource_group_name, domain_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Renew a domain.

Renew a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1510
1511
1512
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1510

def renew_with_http_info(resource_group_name, domain_name, custom_headers:nil)
  renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
end

#update(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Domain

Creates or updates a domain.

Creates or updates a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (DomainPatchResource)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (Domain)

    operation results.



791
792
793
794
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 791

def update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a domain.

Creates or updates a domain.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (DomainPatchResource)

    Domain registration information.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



828
829
830
831
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
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 828

def update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil?
  fail ArgumentError, 'domain is nil' if domain.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::Web::Mgmt::V2018_02_01::Models::DomainPatchResource.mapper()
  request_content = @client.serialize(request_mapper,  domain)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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 == 202 || 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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ DomainOwnershipIdentifier

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

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

    A hash of custom headers that

Returns:

  • (DomainOwnershipIdentifier)

    operation results.



1368
1369
1370
1371
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1368

def update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  response = update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ Concurrent::Promise

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1413

def update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  domain_ownership_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

resource belongs. representation of the domain ownership properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of domain.

  • name (String)

    Name of identifier.

  • domain_ownership_identifier (DomainOwnershipIdentifier)

    A JSON

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1391
1392
1393
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 1391

def update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
end

#update_with_http_info(resource_group_name, domain_name, domain, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a domain.

Creates or updates a domain.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • domain_name (String)

    Name of the domain.

  • domain (DomainPatchResource)

    Domain registration information.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



810
811
812
# File 'lib/2018-02-01/generated/azure_mgmt_web/domains.rb', line 810

def update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil)
  update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
end