azure_mgmt_appconfiguration 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +20 -20
  3. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration.rb +43 -43
  4. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb +1 -1
  5. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb +1386 -1386
  6. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb +111 -111
  7. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb +99 -99
  8. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb +60 -60
  9. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb +126 -126
  10. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb +99 -99
  11. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb +65 -65
  12. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb +57 -57
  13. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb +73 -73
  14. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb +59 -59
  15. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb +81 -81
  16. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb +99 -99
  17. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb +20 -20
  18. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb +46 -46
  19. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb +111 -111
  20. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/module_definition.rb +9 -9
  21. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/operations.rb +339 -339
  22. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration.rb +0 -0
  23. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb +1 -1
  24. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb +0 -0
  25. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/actions_required.rb +0 -0
  26. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb +0 -0
  27. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb +0 -0
  28. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb +0 -0
  29. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb +0 -0
  30. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb +0 -0
  31. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb +0 -0
  32. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/connection_status.rb +0 -0
  33. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/encryption_properties.rb +0 -0
  34. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb +0 -0
  35. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/identity_type.rb +0 -0
  36. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/key_value.rb +0 -0
  37. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/key_vault_properties.rb +0 -0
  38. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/list_key_value_parameters.rb +0 -0
  39. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb +0 -0
  40. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb +0 -0
  41. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb +0 -0
  42. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb +0 -0
  43. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint.rb +0 -0
  44. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint_connection.rb +0 -0
  45. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint_connection_list_result.rb +0 -0
  46. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_resource.rb +0 -0
  47. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_resource_list_result.rb +0 -0
  48. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_service_connection_state.rb +0 -0
  49. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb +0 -0
  50. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb +0 -0
  51. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb +0 -0
  52. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/resource_identity.rb +0 -0
  53. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/sku.rb +0 -0
  54. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/user_identity.rb +0 -0
  55. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/module_definition.rb +0 -0
  56. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/operations.rb +0 -0
  57. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/private_endpoint_connections.rb +0 -0
  58. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/private_link_resources.rb +0 -0
  59. data/lib/azure_mgmt_appconfiguration.rb +0 -0
  60. data/lib/module_definition.rb +7 -7
  61. data/lib/profiles/latest/appconfiguration_latest_profile_client.rb +40 -40
  62. data/lib/profiles/latest/appconfiguration_module_definition.rb +8 -8
  63. data/lib/profiles/latest/modules/appconfiguration_profile_module.rb +0 -0
  64. data/lib/version.rb +1 -1
  65. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70a17b509a0e7510e9a7da716b41f836230f7c16ec1e2f5835d4bd7c8c62fc91
4
- data.tar.gz: 722feeef9d9606f53cd615ebd2bd100324bfbd6b174f92b20f4880b99e41e8d6
3
+ metadata.gz: d010289e0b9912740e0f6f0d6aa6a5f55b188354590a359c03f979627e8b259c
4
+ data.tar.gz: af86f816fed5106ead133c21578aa00f9d1757958b46d3ee6281b9298cb74870
5
5
  SHA512:
6
- metadata.gz: cabefda6e1dd4878a610568efd18f30af362440266e66d0418a995201acc0464ac9e53e578d4cd6cd313b9d0f3c7b7ddfdc9b14b085cbb053ef9c5f569689a06
7
- data.tar.gz: 175d7fc7a5a7d726df10bfa26f3ad6833ef676bbfba97b46cbd00ddd1ccd69cab4d4917b630f7024367363a2d8ea683e104233cd65a51b9b15548c31b134d683
6
+ metadata.gz: 1ec4722adff6412ce28e57faf4147b0da081c51296533ac11a8fd61ade6846d27813e4fab9b8ecc14586ea3f38ac92cf9b9323b5749624cdde907cbac4a61c77
7
+ data.tar.gz: f6b998ae9b98e8aa0e2e45dc1dacaaa59358ba3dcb801d36e021b4aec1a2d818ad1570bea690db97cacfc9d54a3161780aefbe410f4d94b4c27b809cbc6c2497
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Microsoft Corporation
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
@@ -1,43 +1,43 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator.
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- require 'uri'
7
- require 'cgi'
8
- require 'date'
9
- require 'json'
10
- require 'base64'
11
- require 'erb'
12
- require 'securerandom'
13
- require 'time'
14
- require 'timeliness'
15
- require 'faraday'
16
- require 'faraday-cookie_jar'
17
- require 'concurrent'
18
- require 'ms_rest'
19
- require '2019-02-01-preview/generated/azure_mgmt_appconfiguration/module_definition'
20
- require 'ms_rest_azure'
21
-
22
- module Azure::Appconfiguration::Mgmt::V2019_02_01_preview
23
- autoload :ConfigurationStores, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb'
24
- autoload :Operations, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/operations.rb'
25
- autoload :AppConfigurationManagementClient, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb'
26
-
27
- module Models
28
- autoload :ApiKeyListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb'
29
- autoload :RegenerateKeyParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb'
30
- autoload :ConfigurationStoreListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb'
31
- autoload :OperationDefinitionDisplay, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb'
32
- autoload :CheckNameAvailabilityParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb'
33
- autoload :OperationDefinition, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb'
34
- autoload :ApiKey, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb'
35
- autoload :OperationDefinitionListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb'
36
- autoload :ConfigurationStoreUpdateParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb'
37
- autoload :Error, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb'
38
- autoload :NameAvailabilityStatus, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb'
39
- autoload :Resource, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb'
40
- autoload :ConfigurationStore, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb'
41
- autoload :ProvisioningState, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb'
42
- end
43
- end
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2019-02-01-preview/generated/azure_mgmt_appconfiguration/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Appconfiguration::Mgmt::V2019_02_01_preview
23
+ autoload :ConfigurationStores, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb'
24
+ autoload :Operations, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/operations.rb'
25
+ autoload :AppConfigurationManagementClient, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb'
26
+
27
+ module Models
28
+ autoload :ApiKeyListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb'
29
+ autoload :RegenerateKeyParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb'
30
+ autoload :ConfigurationStoreListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb'
31
+ autoload :OperationDefinitionDisplay, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb'
32
+ autoload :CheckNameAvailabilityParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb'
33
+ autoload :OperationDefinition, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb'
34
+ autoload :ApiKey, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb'
35
+ autoload :OperationDefinitionListResult, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb'
36
+ autoload :ConfigurationStoreUpdateParameters, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb'
37
+ autoload :Error, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb'
38
+ autoload :NameAvailabilityStatus, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb'
39
+ autoload :Resource, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb'
40
+ autoload :ConfigurationStore, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb'
41
+ autoload :ProvisioningState, '2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb'
42
+ end
43
+ end
@@ -128,7 +128,7 @@ module Azure::Appconfiguration::Mgmt::V2019_02_01_preview
128
128
  #
129
129
  def add_telemetry
130
130
  sdk_information = 'azure_mgmt_appconfiguration'
131
- sdk_information = "#{sdk_information}/0.17.1"
131
+ sdk_information = "#{sdk_information}/0.17.2"
132
132
  add_user_agent_information(sdk_information)
133
133
  end
134
134
  end
@@ -1,1386 +1,1386 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator.
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::Appconfiguration::Mgmt::V2019_02_01_preview
7
- #
8
- # ConfigurationStores
9
- #
10
- class ConfigurationStores
11
- include MsRestAzure
12
-
13
- #
14
- # Creates and initializes a new instance of the ConfigurationStores class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [AppConfigurationManagementClient] reference to the AppConfigurationManagementClient
22
- attr_reader :client
23
-
24
- #
25
- # Lists the configuration stores for a given subscription.
26
- #
27
- # @param skip_token [String] A skip token is used to continue retrieving items
28
- # after an operation returns a partial result. If a previous response contains
29
- # a nextLink element, the value of the nextLink element will include a
30
- # skipToken parameter that specifies a starting point to use for subsequent
31
- # calls.
32
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
- # will be added to the HTTP request.
34
- #
35
- # @return [Array<ConfigurationStore>] operation results.
36
- #
37
- def list(skip_token:nil, custom_headers:nil)
38
- first_page = list_as_lazy(skip_token:skip_token, custom_headers:custom_headers)
39
- first_page.get_all_items
40
- end
41
-
42
- #
43
- # Lists the configuration stores for a given subscription.
44
- #
45
- # @param skip_token [String] A skip token is used to continue retrieving items
46
- # after an operation returns a partial result. If a previous response contains
47
- # a nextLink element, the value of the nextLink element will include a
48
- # skipToken parameter that specifies a starting point to use for subsequent
49
- # calls.
50
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
- # will be added to the HTTP request.
52
- #
53
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
- #
55
- def list_with_http_info(skip_token:nil, custom_headers:nil)
56
- list_async(skip_token:skip_token, custom_headers:custom_headers).value!
57
- end
58
-
59
- #
60
- # Lists the configuration stores for a given subscription.
61
- #
62
- # @param skip_token [String] A skip token is used to continue retrieving items
63
- # after an operation returns a partial result. If a previous response contains
64
- # a nextLink element, the value of the nextLink element will include a
65
- # skipToken parameter that specifies a starting point to use for subsequent
66
- # calls.
67
- # @param [Hash{String => String}] A hash of custom headers that will be added
68
- # to the HTTP request.
69
- #
70
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
- #
72
- def list_async(skip_token:nil, custom_headers:nil)
73
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
-
76
-
77
- request_headers = {}
78
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
-
80
- # Set Headers
81
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
- path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores'
84
-
85
- request_url = @base_url || @client.base_url
86
-
87
- options = {
88
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
- path_params: {'subscriptionId' => @client.subscription_id},
90
- query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
91
- headers: request_headers.merge(custom_headers || {}),
92
- base_url: request_url
93
- }
94
- promise = @client.make_request_async(:get, path_template, options)
95
-
96
- promise = promise.then do |result|
97
- http_response = result.response
98
- status_code = http_response.status
99
- response_content = http_response.body
100
- unless status_code == 200
101
- error_model = JSON.load(response_content)
102
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
103
- end
104
-
105
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
107
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
108
- # Deserialize Response
109
- if status_code == 200
110
- begin
111
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
113
- result.body = @client.deserialize(result_mapper, parsed_response)
114
- rescue Exception => e
115
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
- end
117
- end
118
-
119
- result
120
- end
121
-
122
- promise.execute
123
- end
124
-
125
- #
126
- # Lists the configuration stores for a given resource group.
127
- #
128
- # @param resource_group_name [String] The name of the resource group to which
129
- # the container registry belongs.
130
- # @param skip_token [String] A skip token is used to continue retrieving items
131
- # after an operation returns a partial result. If a previous response contains
132
- # a nextLink element, the value of the nextLink element will include a
133
- # skipToken parameter that specifies a starting point to use for subsequent
134
- # calls.
135
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
- # will be added to the HTTP request.
137
- #
138
- # @return [Array<ConfigurationStore>] operation results.
139
- #
140
- def list_by_resource_group(resource_group_name, skip_token:nil, custom_headers:nil)
141
- first_page = list_by_resource_group_as_lazy(resource_group_name, skip_token:skip_token, custom_headers:custom_headers)
142
- first_page.get_all_items
143
- end
144
-
145
- #
146
- # Lists the configuration stores for a given resource group.
147
- #
148
- # @param resource_group_name [String] The name of the resource group to which
149
- # the container registry belongs.
150
- # @param skip_token [String] A skip token is used to continue retrieving items
151
- # after an operation returns a partial result. If a previous response contains
152
- # a nextLink element, the value of the nextLink element will include a
153
- # skipToken parameter that specifies a starting point to use for subsequent
154
- # calls.
155
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
- # will be added to the HTTP request.
157
- #
158
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
- #
160
- def list_by_resource_group_with_http_info(resource_group_name, skip_token:nil, custom_headers:nil)
161
- list_by_resource_group_async(resource_group_name, skip_token:skip_token, custom_headers:custom_headers).value!
162
- end
163
-
164
- #
165
- # Lists the configuration stores for a given resource group.
166
- #
167
- # @param resource_group_name [String] The name of the resource group to which
168
- # the container registry belongs.
169
- # @param skip_token [String] A skip token is used to continue retrieving items
170
- # after an operation returns a partial result. If a previous response contains
171
- # a nextLink element, the value of the nextLink element will include a
172
- # skipToken parameter that specifies a starting point to use for subsequent
173
- # calls.
174
- # @param [Hash{String => String}] A hash of custom headers that will be added
175
- # to the HTTP request.
176
- #
177
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
178
- #
179
- def list_by_resource_group_async(resource_group_name, skip_token:nil, custom_headers:nil)
180
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
181
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
182
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
183
-
184
-
185
- request_headers = {}
186
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
187
-
188
- # Set Headers
189
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
190
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
191
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores'
192
-
193
- request_url = @base_url || @client.base_url
194
-
195
- options = {
196
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
197
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
198
- query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
199
- headers: request_headers.merge(custom_headers || {}),
200
- base_url: request_url
201
- }
202
- promise = @client.make_request_async(:get, path_template, options)
203
-
204
- promise = promise.then do |result|
205
- http_response = result.response
206
- status_code = http_response.status
207
- response_content = http_response.body
208
- unless status_code == 200
209
- error_model = JSON.load(response_content)
210
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
211
- end
212
-
213
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
214
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
215
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
216
- # Deserialize Response
217
- if status_code == 200
218
- begin
219
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
220
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
221
- result.body = @client.deserialize(result_mapper, parsed_response)
222
- rescue Exception => e
223
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
224
- end
225
- end
226
-
227
- result
228
- end
229
-
230
- promise.execute
231
- end
232
-
233
- #
234
- # Gets the properties of the specified configuration store.
235
- #
236
- # @param resource_group_name [String] The name of the resource group to which
237
- # the container registry belongs.
238
- # @param config_store_name [String] The name of the configuration store.
239
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
- # will be added to the HTTP request.
241
- #
242
- # @return [ConfigurationStore] operation results.
243
- #
244
- def get(resource_group_name, config_store_name, custom_headers:nil)
245
- response = get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
246
- response.body unless response.nil?
247
- end
248
-
249
- #
250
- # Gets the properties of the specified configuration store.
251
- #
252
- # @param resource_group_name [String] The name of the resource group to which
253
- # the container registry belongs.
254
- # @param config_store_name [String] The name of the configuration store.
255
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
- # will be added to the HTTP request.
257
- #
258
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
- #
260
- def get_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
261
- get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
262
- end
263
-
264
- #
265
- # Gets the properties of the specified configuration store.
266
- #
267
- # @param resource_group_name [String] The name of the resource group to which
268
- # the container registry belongs.
269
- # @param config_store_name [String] The name of the configuration store.
270
- # @param [Hash{String => String}] A hash of custom headers that will be added
271
- # to the HTTP request.
272
- #
273
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
274
- #
275
- def get_async(resource_group_name, config_store_name, custom_headers:nil)
276
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
277
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
279
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
280
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
281
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
282
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
283
-
284
-
285
- request_headers = {}
286
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
287
-
288
- # Set Headers
289
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
290
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
291
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
292
-
293
- request_url = @base_url || @client.base_url
294
-
295
- options = {
296
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
297
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
298
- query_params: {'api-version' => @client.api_version},
299
- headers: request_headers.merge(custom_headers || {}),
300
- base_url: request_url
301
- }
302
- promise = @client.make_request_async(:get, path_template, options)
303
-
304
- promise = promise.then do |result|
305
- http_response = result.response
306
- status_code = http_response.status
307
- response_content = http_response.body
308
- unless status_code == 200
309
- error_model = JSON.load(response_content)
310
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
311
- end
312
-
313
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
314
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
315
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
316
- # Deserialize Response
317
- if status_code == 200
318
- begin
319
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
320
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
321
- result.body = @client.deserialize(result_mapper, parsed_response)
322
- rescue Exception => e
323
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
324
- end
325
- end
326
-
327
- result
328
- end
329
-
330
- promise.execute
331
- end
332
-
333
- #
334
- # Creates a configuration store with the specified parameters.
335
- #
336
- # @param resource_group_name [String] The name of the resource group to which
337
- # the container registry belongs.
338
- # @param config_store_name [String] The name of the configuration store.
339
- # @param config_store_creation_parameters [ConfigurationStore] The parameters
340
- # for creating a configuration store.
341
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
- # will be added to the HTTP request.
343
- #
344
- # @return [ConfigurationStore] operation results.
345
- #
346
- def create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
347
- response = create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
348
- response.body unless response.nil?
349
- end
350
-
351
- #
352
- # @param resource_group_name [String] The name of the resource group to which
353
- # the container registry belongs.
354
- # @param config_store_name [String] The name of the configuration store.
355
- # @param config_store_creation_parameters [ConfigurationStore] The parameters
356
- # for creating a configuration store.
357
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
- # will be added to the HTTP request.
359
- #
360
- # @return [Concurrent::Promise] promise which provides async access to http
361
- # response.
362
- #
363
- def create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
364
- # Send request
365
- promise = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers)
366
-
367
- promise = promise.then do |response|
368
- # Defining deserialization method.
369
- deserialize_method = lambda do |parsed_response|
370
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
371
- parsed_response = @client.deserialize(result_mapper, parsed_response)
372
- end
373
-
374
- # Waiting for response.
375
- @client.get_long_running_operation_result(response, deserialize_method)
376
- end
377
-
378
- promise
379
- end
380
-
381
- #
382
- # Deletes a configuration store.
383
- #
384
- # @param resource_group_name [String] The name of the resource group to which
385
- # the container registry belongs.
386
- # @param config_store_name [String] The name of the configuration store.
387
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
388
- # will be added to the HTTP request.
389
- #
390
- def delete(resource_group_name, config_store_name, custom_headers:nil)
391
- response = delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
392
- nil
393
- end
394
-
395
- #
396
- # @param resource_group_name [String] The name of the resource group to which
397
- # the container registry belongs.
398
- # @param config_store_name [String] The name of the configuration store.
399
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
- # will be added to the HTTP request.
401
- #
402
- # @return [Concurrent::Promise] promise which provides async access to http
403
- # response.
404
- #
405
- def delete_async(resource_group_name, config_store_name, custom_headers:nil)
406
- # Send request
407
- promise = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers)
408
-
409
- promise = promise.then do |response|
410
- # Defining deserialization method.
411
- deserialize_method = lambda do |parsed_response|
412
- end
413
-
414
- # Waiting for response.
415
- @client.get_long_running_operation_result(response, deserialize_method)
416
- end
417
-
418
- promise
419
- end
420
-
421
- #
422
- # Updates a configuration store with the specified parameters.
423
- #
424
- # @param resource_group_name [String] The name of the resource group to which
425
- # the container registry belongs.
426
- # @param config_store_name [String] The name of the configuration store.
427
- # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
428
- # The parameters for updating a configuration store.
429
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
430
- # will be added to the HTTP request.
431
- #
432
- # @return [ConfigurationStore] operation results.
433
- #
434
- def update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
435
- response = update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
436
- response.body unless response.nil?
437
- end
438
-
439
- #
440
- # @param resource_group_name [String] The name of the resource group to which
441
- # the container registry belongs.
442
- # @param config_store_name [String] The name of the configuration store.
443
- # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
444
- # The parameters for updating a configuration store.
445
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
- # will be added to the HTTP request.
447
- #
448
- # @return [Concurrent::Promise] promise which provides async access to http
449
- # response.
450
- #
451
- def update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
452
- # Send request
453
- promise = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers)
454
-
455
- promise = promise.then do |response|
456
- # Defining deserialization method.
457
- deserialize_method = lambda do |parsed_response|
458
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
459
- parsed_response = @client.deserialize(result_mapper, parsed_response)
460
- end
461
-
462
- # Waiting for response.
463
- @client.get_long_running_operation_result(response, deserialize_method)
464
- end
465
-
466
- promise
467
- end
468
-
469
- #
470
- # Lists the access key for the specified configuration store.
471
- #
472
- # @param resource_group_name [String] The name of the resource group to which
473
- # the container registry belongs.
474
- # @param config_store_name [String] The name of the configuration store.
475
- # @param skip_token [String] A skip token is used to continue retrieving items
476
- # after an operation returns a partial result. If a previous response contains
477
- # a nextLink element, the value of the nextLink element will include a
478
- # skipToken parameter that specifies a starting point to use for subsequent
479
- # calls.
480
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
481
- # will be added to the HTTP request.
482
- #
483
- # @return [Array<ApiKey>] operation results.
484
- #
485
- def list_keys(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
486
- first_page = list_keys_as_lazy(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers)
487
- first_page.get_all_items
488
- end
489
-
490
- #
491
- # Lists the access key for the specified configuration store.
492
- #
493
- # @param resource_group_name [String] The name of the resource group to which
494
- # the container registry belongs.
495
- # @param config_store_name [String] The name of the configuration store.
496
- # @param skip_token [String] A skip token is used to continue retrieving items
497
- # after an operation returns a partial result. If a previous response contains
498
- # a nextLink element, the value of the nextLink element will include a
499
- # skipToken parameter that specifies a starting point to use for subsequent
500
- # calls.
501
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
- # will be added to the HTTP request.
503
- #
504
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
505
- #
506
- def list_keys_with_http_info(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
507
- list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
508
- end
509
-
510
- #
511
- # Lists the access key for the specified configuration store.
512
- #
513
- # @param resource_group_name [String] The name of the resource group to which
514
- # the container registry belongs.
515
- # @param config_store_name [String] The name of the configuration store.
516
- # @param skip_token [String] A skip token is used to continue retrieving items
517
- # after an operation returns a partial result. If a previous response contains
518
- # a nextLink element, the value of the nextLink element will include a
519
- # skipToken parameter that specifies a starting point to use for subsequent
520
- # calls.
521
- # @param [Hash{String => String}] A hash of custom headers that will be added
522
- # to the HTTP request.
523
- #
524
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
525
- #
526
- def list_keys_async(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
527
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
528
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
529
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
530
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
531
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
532
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
533
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
534
-
535
-
536
- request_headers = {}
537
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
-
539
- # Set Headers
540
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys'
543
-
544
- request_url = @base_url || @client.base_url
545
-
546
- options = {
547
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
548
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
549
- query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
550
- headers: request_headers.merge(custom_headers || {}),
551
- base_url: request_url
552
- }
553
- promise = @client.make_request_async(:post, path_template, options)
554
-
555
- promise = promise.then do |result|
556
- http_response = result.response
557
- status_code = http_response.status
558
- response_content = http_response.body
559
- unless status_code == 200
560
- error_model = JSON.load(response_content)
561
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
562
- end
563
-
564
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
565
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
566
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
567
- # Deserialize Response
568
- if status_code == 200
569
- begin
570
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
571
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKeyListResult.mapper()
572
- result.body = @client.deserialize(result_mapper, parsed_response)
573
- rescue Exception => e
574
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
575
- end
576
- end
577
-
578
- result
579
- end
580
-
581
- promise.execute
582
- end
583
-
584
- #
585
- # Regenerates an access key for the specified configuration store.
586
- #
587
- # @param resource_group_name [String] The name of the resource group to which
588
- # the container registry belongs.
589
- # @param config_store_name [String] The name of the configuration store.
590
- # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
591
- # regenerating an access key.
592
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
593
- # will be added to the HTTP request.
594
- #
595
- # @return [ApiKey] operation results.
596
- #
597
- def regenerate_key(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
598
- response = regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
599
- response.body unless response.nil?
600
- end
601
-
602
- #
603
- # Regenerates an access key for the specified configuration store.
604
- #
605
- # @param resource_group_name [String] The name of the resource group to which
606
- # the container registry belongs.
607
- # @param config_store_name [String] The name of the configuration store.
608
- # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
609
- # regenerating an access key.
610
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
611
- # will be added to the HTTP request.
612
- #
613
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
614
- #
615
- def regenerate_key_with_http_info(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
616
- regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
617
- end
618
-
619
- #
620
- # Regenerates an access key for the specified configuration store.
621
- #
622
- # @param resource_group_name [String] The name of the resource group to which
623
- # the container registry belongs.
624
- # @param config_store_name [String] The name of the configuration store.
625
- # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
626
- # regenerating an access key.
627
- # @param [Hash{String => String}] A hash of custom headers that will be added
628
- # to the HTTP request.
629
- #
630
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
- #
632
- def regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
633
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
634
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
635
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
636
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
637
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
638
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
639
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
640
- fail ArgumentError, 'regenerate_key_parameters is nil' if regenerate_key_parameters.nil?
641
-
642
-
643
- request_headers = {}
644
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
-
646
- # Set Headers
647
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
-
650
- # Serialize Request
651
- request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::RegenerateKeyParameters.mapper()
652
- request_content = @client.serialize(request_mapper, regenerate_key_parameters)
653
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
654
-
655
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'
656
-
657
- request_url = @base_url || @client.base_url
658
-
659
- options = {
660
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
661
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
662
- query_params: {'api-version' => @client.api_version},
663
- body: request_content,
664
- headers: request_headers.merge(custom_headers || {}),
665
- base_url: request_url
666
- }
667
- promise = @client.make_request_async(:post, path_template, options)
668
-
669
- promise = promise.then do |result|
670
- http_response = result.response
671
- status_code = http_response.status
672
- response_content = http_response.body
673
- unless status_code == 200
674
- error_model = JSON.load(response_content)
675
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
676
- end
677
-
678
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
- # Deserialize Response
682
- if status_code == 200
683
- begin
684
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
685
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKey.mapper()
686
- result.body = @client.deserialize(result_mapper, parsed_response)
687
- rescue Exception => e
688
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
689
- end
690
- end
691
-
692
- result
693
- end
694
-
695
- promise.execute
696
- end
697
-
698
- #
699
- # Creates a configuration store with the specified parameters.
700
- #
701
- # @param resource_group_name [String] The name of the resource group to which
702
- # the container registry belongs.
703
- # @param config_store_name [String] The name of the configuration store.
704
- # @param config_store_creation_parameters [ConfigurationStore] The parameters
705
- # for creating a configuration store.
706
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
707
- # will be added to the HTTP request.
708
- #
709
- # @return [ConfigurationStore] operation results.
710
- #
711
- def begin_create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
712
- response = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
713
- response.body unless response.nil?
714
- end
715
-
716
- #
717
- # Creates a configuration store with the specified parameters.
718
- #
719
- # @param resource_group_name [String] The name of the resource group to which
720
- # the container registry belongs.
721
- # @param config_store_name [String] The name of the configuration store.
722
- # @param config_store_creation_parameters [ConfigurationStore] The parameters
723
- # for creating a configuration store.
724
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
725
- # will be added to the HTTP request.
726
- #
727
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
728
- #
729
- def begin_create_with_http_info(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
730
- begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
731
- end
732
-
733
- #
734
- # Creates a configuration store with the specified parameters.
735
- #
736
- # @param resource_group_name [String] The name of the resource group to which
737
- # the container registry belongs.
738
- # @param config_store_name [String] The name of the configuration store.
739
- # @param config_store_creation_parameters [ConfigurationStore] The parameters
740
- # for creating a configuration store.
741
- # @param [Hash{String => String}] A hash of custom headers that will be added
742
- # to the HTTP request.
743
- #
744
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
745
- #
746
- def begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
747
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
748
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
749
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
750
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
751
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
752
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
753
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
754
- fail ArgumentError, 'config_store_creation_parameters is nil' if config_store_creation_parameters.nil?
755
-
756
-
757
- request_headers = {}
758
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
759
-
760
- # Set Headers
761
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
762
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
763
-
764
- # Serialize Request
765
- request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
766
- request_content = @client.serialize(request_mapper, config_store_creation_parameters)
767
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
768
-
769
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
770
-
771
- request_url = @base_url || @client.base_url
772
-
773
- options = {
774
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
775
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
776
- query_params: {'api-version' => @client.api_version},
777
- body: request_content,
778
- headers: request_headers.merge(custom_headers || {}),
779
- base_url: request_url
780
- }
781
- promise = @client.make_request_async(:put, path_template, options)
782
-
783
- promise = promise.then do |result|
784
- http_response = result.response
785
- status_code = http_response.status
786
- response_content = http_response.body
787
- unless status_code == 200 || status_code == 201
788
- error_model = JSON.load(response_content)
789
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
790
- end
791
-
792
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
793
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
794
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
795
- # Deserialize Response
796
- if status_code == 200
797
- begin
798
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
799
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
800
- result.body = @client.deserialize(result_mapper, parsed_response)
801
- rescue Exception => e
802
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
803
- end
804
- end
805
- # Deserialize Response
806
- if status_code == 201
807
- begin
808
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
809
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
810
- result.body = @client.deserialize(result_mapper, parsed_response)
811
- rescue Exception => e
812
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
813
- end
814
- end
815
-
816
- result
817
- end
818
-
819
- promise.execute
820
- end
821
-
822
- #
823
- # Deletes a configuration store.
824
- #
825
- # @param resource_group_name [String] The name of the resource group to which
826
- # the container registry belongs.
827
- # @param config_store_name [String] The name of the configuration store.
828
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
829
- # will be added to the HTTP request.
830
- #
831
- #
832
- def begin_delete(resource_group_name, config_store_name, custom_headers:nil)
833
- response = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
834
- nil
835
- end
836
-
837
- #
838
- # Deletes a configuration store.
839
- #
840
- # @param resource_group_name [String] The name of the resource group to which
841
- # the container registry belongs.
842
- # @param config_store_name [String] The name of the configuration store.
843
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
844
- # will be added to the HTTP request.
845
- #
846
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
847
- #
848
- def begin_delete_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
849
- begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
850
- end
851
-
852
- #
853
- # Deletes a configuration store.
854
- #
855
- # @param resource_group_name [String] The name of the resource group to which
856
- # the container registry belongs.
857
- # @param config_store_name [String] The name of the configuration store.
858
- # @param [Hash{String => String}] A hash of custom headers that will be added
859
- # to the HTTP request.
860
- #
861
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
862
- #
863
- def begin_delete_async(resource_group_name, config_store_name, custom_headers:nil)
864
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
865
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
866
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
867
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
868
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
869
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
870
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
871
-
872
-
873
- request_headers = {}
874
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
875
-
876
- # Set Headers
877
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
878
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
879
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
880
-
881
- request_url = @base_url || @client.base_url
882
-
883
- options = {
884
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
885
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
886
- query_params: {'api-version' => @client.api_version},
887
- headers: request_headers.merge(custom_headers || {}),
888
- base_url: request_url
889
- }
890
- promise = @client.make_request_async(:delete, path_template, options)
891
-
892
- promise = promise.then do |result|
893
- http_response = result.response
894
- status_code = http_response.status
895
- response_content = http_response.body
896
- unless status_code == 200 || status_code == 202 || status_code == 204
897
- error_model = JSON.load(response_content)
898
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
899
- end
900
-
901
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
902
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
903
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
904
-
905
- result
906
- end
907
-
908
- promise.execute
909
- end
910
-
911
- #
912
- # Updates a configuration store with the specified parameters.
913
- #
914
- # @param resource_group_name [String] The name of the resource group to which
915
- # the container registry belongs.
916
- # @param config_store_name [String] The name of the configuration store.
917
- # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
918
- # The parameters for updating a configuration store.
919
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
920
- # will be added to the HTTP request.
921
- #
922
- # @return [ConfigurationStore] operation results.
923
- #
924
- def begin_update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
925
- response = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
926
- response.body unless response.nil?
927
- end
928
-
929
- #
930
- # Updates a configuration store with the specified parameters.
931
- #
932
- # @param resource_group_name [String] The name of the resource group to which
933
- # the container registry belongs.
934
- # @param config_store_name [String] The name of the configuration store.
935
- # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
936
- # The parameters for updating a configuration store.
937
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
938
- # will be added to the HTTP request.
939
- #
940
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
941
- #
942
- def begin_update_with_http_info(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
943
- begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
944
- end
945
-
946
- #
947
- # Updates a configuration store with the specified parameters.
948
- #
949
- # @param resource_group_name [String] The name of the resource group to which
950
- # the container registry belongs.
951
- # @param config_store_name [String] The name of the configuration store.
952
- # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
953
- # The parameters for updating a configuration store.
954
- # @param [Hash{String => String}] A hash of custom headers that will be added
955
- # to the HTTP request.
956
- #
957
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
958
- #
959
- def begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
960
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
961
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
962
- fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
963
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
964
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
965
- fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
966
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
967
- fail ArgumentError, 'config_store_update_parameters is nil' if config_store_update_parameters.nil?
968
-
969
-
970
- request_headers = {}
971
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
972
-
973
- # Set Headers
974
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
975
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
976
-
977
- # Serialize Request
978
- request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreUpdateParameters.mapper()
979
- request_content = @client.serialize(request_mapper, config_store_update_parameters)
980
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
981
-
982
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
983
-
984
- request_url = @base_url || @client.base_url
985
-
986
- options = {
987
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
988
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
989
- query_params: {'api-version' => @client.api_version},
990
- body: request_content,
991
- headers: request_headers.merge(custom_headers || {}),
992
- base_url: request_url
993
- }
994
- promise = @client.make_request_async(:patch, path_template, options)
995
-
996
- promise = promise.then do |result|
997
- http_response = result.response
998
- status_code = http_response.status
999
- response_content = http_response.body
1000
- unless status_code == 200 || status_code == 201
1001
- error_model = JSON.load(response_content)
1002
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1003
- end
1004
-
1005
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1006
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1007
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1008
- # Deserialize Response
1009
- if status_code == 200
1010
- begin
1011
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1012
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
1013
- result.body = @client.deserialize(result_mapper, parsed_response)
1014
- rescue Exception => e
1015
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1016
- end
1017
- end
1018
- # Deserialize Response
1019
- if status_code == 201
1020
- begin
1021
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1022
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
1023
- result.body = @client.deserialize(result_mapper, parsed_response)
1024
- rescue Exception => e
1025
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1026
- end
1027
- end
1028
-
1029
- result
1030
- end
1031
-
1032
- promise.execute
1033
- end
1034
-
1035
- #
1036
- # Lists the configuration stores for a given subscription.
1037
- #
1038
- # @param next_page_link [String] The NextLink from the previous successful call
1039
- # to List operation.
1040
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1041
- # will be added to the HTTP request.
1042
- #
1043
- # @return [ConfigurationStoreListResult] operation results.
1044
- #
1045
- def list_next(next_page_link, custom_headers:nil)
1046
- response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1047
- response.body unless response.nil?
1048
- end
1049
-
1050
- #
1051
- # Lists the configuration stores for a given subscription.
1052
- #
1053
- # @param next_page_link [String] The NextLink from the previous successful call
1054
- # to List operation.
1055
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1056
- # will be added to the HTTP request.
1057
- #
1058
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1059
- #
1060
- def list_next_with_http_info(next_page_link, custom_headers:nil)
1061
- list_next_async(next_page_link, custom_headers:custom_headers).value!
1062
- end
1063
-
1064
- #
1065
- # Lists the configuration stores for a given subscription.
1066
- #
1067
- # @param next_page_link [String] The NextLink from the previous successful call
1068
- # to List operation.
1069
- # @param [Hash{String => String}] A hash of custom headers that will be added
1070
- # to the HTTP request.
1071
- #
1072
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1073
- #
1074
- def list_next_async(next_page_link, custom_headers:nil)
1075
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1076
-
1077
-
1078
- request_headers = {}
1079
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1080
-
1081
- # Set Headers
1082
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1083
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1084
- path_template = '{nextLink}'
1085
-
1086
- request_url = @base_url || @client.base_url
1087
-
1088
- options = {
1089
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1090
- skip_encoding_path_params: {'nextLink' => next_page_link},
1091
- headers: request_headers.merge(custom_headers || {}),
1092
- base_url: request_url
1093
- }
1094
- promise = @client.make_request_async(:get, path_template, options)
1095
-
1096
- promise = promise.then do |result|
1097
- http_response = result.response
1098
- status_code = http_response.status
1099
- response_content = http_response.body
1100
- unless status_code == 200
1101
- error_model = JSON.load(response_content)
1102
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1103
- end
1104
-
1105
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1106
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1107
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1108
- # Deserialize Response
1109
- if status_code == 200
1110
- begin
1111
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1112
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
1113
- result.body = @client.deserialize(result_mapper, parsed_response)
1114
- rescue Exception => e
1115
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1116
- end
1117
- end
1118
-
1119
- result
1120
- end
1121
-
1122
- promise.execute
1123
- end
1124
-
1125
- #
1126
- # Lists the configuration stores for a given resource group.
1127
- #
1128
- # @param next_page_link [String] The NextLink from the previous successful call
1129
- # to List operation.
1130
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1131
- # will be added to the HTTP request.
1132
- #
1133
- # @return [ConfigurationStoreListResult] operation results.
1134
- #
1135
- def list_by_resource_group_next(next_page_link, custom_headers:nil)
1136
- response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1137
- response.body unless response.nil?
1138
- end
1139
-
1140
- #
1141
- # Lists the configuration stores for a given resource group.
1142
- #
1143
- # @param next_page_link [String] The NextLink from the previous successful call
1144
- # to List operation.
1145
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1146
- # will be added to the HTTP request.
1147
- #
1148
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1149
- #
1150
- def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1151
- list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1152
- end
1153
-
1154
- #
1155
- # Lists the configuration stores for a given resource group.
1156
- #
1157
- # @param next_page_link [String] The NextLink from the previous successful call
1158
- # to List operation.
1159
- # @param [Hash{String => String}] A hash of custom headers that will be added
1160
- # to the HTTP request.
1161
- #
1162
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1163
- #
1164
- def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1165
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1166
-
1167
-
1168
- request_headers = {}
1169
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1170
-
1171
- # Set Headers
1172
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1173
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1174
- path_template = '{nextLink}'
1175
-
1176
- request_url = @base_url || @client.base_url
1177
-
1178
- options = {
1179
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1180
- skip_encoding_path_params: {'nextLink' => next_page_link},
1181
- headers: request_headers.merge(custom_headers || {}),
1182
- base_url: request_url
1183
- }
1184
- promise = @client.make_request_async(:get, path_template, options)
1185
-
1186
- promise = promise.then do |result|
1187
- http_response = result.response
1188
- status_code = http_response.status
1189
- response_content = http_response.body
1190
- unless status_code == 200
1191
- error_model = JSON.load(response_content)
1192
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1193
- end
1194
-
1195
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1196
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1197
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1198
- # Deserialize Response
1199
- if status_code == 200
1200
- begin
1201
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1202
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
1203
- result.body = @client.deserialize(result_mapper, parsed_response)
1204
- rescue Exception => e
1205
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1206
- end
1207
- end
1208
-
1209
- result
1210
- end
1211
-
1212
- promise.execute
1213
- end
1214
-
1215
- #
1216
- # Lists the access key for the specified configuration store.
1217
- #
1218
- # @param next_page_link [String] The NextLink from the previous successful call
1219
- # to List operation.
1220
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1221
- # will be added to the HTTP request.
1222
- #
1223
- # @return [ApiKeyListResult] operation results.
1224
- #
1225
- def list_keys_next(next_page_link, custom_headers:nil)
1226
- response = list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
1227
- response.body unless response.nil?
1228
- end
1229
-
1230
- #
1231
- # Lists the access key for the specified configuration store.
1232
- #
1233
- # @param next_page_link [String] The NextLink from the previous successful call
1234
- # to List operation.
1235
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1236
- # will be added to the HTTP request.
1237
- #
1238
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1239
- #
1240
- def list_keys_next_with_http_info(next_page_link, custom_headers:nil)
1241
- list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
1242
- end
1243
-
1244
- #
1245
- # Lists the access key for the specified configuration store.
1246
- #
1247
- # @param next_page_link [String] The NextLink from the previous successful call
1248
- # to List operation.
1249
- # @param [Hash{String => String}] A hash of custom headers that will be added
1250
- # to the HTTP request.
1251
- #
1252
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1253
- #
1254
- def list_keys_next_async(next_page_link, custom_headers:nil)
1255
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1256
-
1257
-
1258
- request_headers = {}
1259
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1260
-
1261
- # Set Headers
1262
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1263
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1264
- path_template = '{nextLink}'
1265
-
1266
- request_url = @base_url || @client.base_url
1267
-
1268
- options = {
1269
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1270
- skip_encoding_path_params: {'nextLink' => next_page_link},
1271
- headers: request_headers.merge(custom_headers || {}),
1272
- base_url: request_url
1273
- }
1274
- promise = @client.make_request_async(:post, path_template, options)
1275
-
1276
- promise = promise.then do |result|
1277
- http_response = result.response
1278
- status_code = http_response.status
1279
- response_content = http_response.body
1280
- unless status_code == 200
1281
- error_model = JSON.load(response_content)
1282
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1283
- end
1284
-
1285
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1286
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1287
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1288
- # Deserialize Response
1289
- if status_code == 200
1290
- begin
1291
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1292
- result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKeyListResult.mapper()
1293
- result.body = @client.deserialize(result_mapper, parsed_response)
1294
- rescue Exception => e
1295
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1296
- end
1297
- end
1298
-
1299
- result
1300
- end
1301
-
1302
- promise.execute
1303
- end
1304
-
1305
- #
1306
- # Lists the configuration stores for a given subscription.
1307
- #
1308
- # @param skip_token [String] A skip token is used to continue retrieving items
1309
- # after an operation returns a partial result. If a previous response contains
1310
- # a nextLink element, the value of the nextLink element will include a
1311
- # skipToken parameter that specifies a starting point to use for subsequent
1312
- # calls.
1313
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1314
- # will be added to the HTTP request.
1315
- #
1316
- # @return [ConfigurationStoreListResult] which provide lazy access to pages of
1317
- # the response.
1318
- #
1319
- def list_as_lazy(skip_token:nil, custom_headers:nil)
1320
- response = list_async(skip_token:skip_token, custom_headers:custom_headers).value!
1321
- unless response.nil?
1322
- page = response.body
1323
- page.next_method = Proc.new do |next_page_link|
1324
- list_next_async(next_page_link, custom_headers:custom_headers)
1325
- end
1326
- page
1327
- end
1328
- end
1329
-
1330
- #
1331
- # Lists the configuration stores for a given resource group.
1332
- #
1333
- # @param resource_group_name [String] The name of the resource group to which
1334
- # the container registry belongs.
1335
- # @param skip_token [String] A skip token is used to continue retrieving items
1336
- # after an operation returns a partial result. If a previous response contains
1337
- # a nextLink element, the value of the nextLink element will include a
1338
- # skipToken parameter that specifies a starting point to use for subsequent
1339
- # calls.
1340
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1341
- # will be added to the HTTP request.
1342
- #
1343
- # @return [ConfigurationStoreListResult] which provide lazy access to pages of
1344
- # the response.
1345
- #
1346
- def list_by_resource_group_as_lazy(resource_group_name, skip_token:nil, custom_headers:nil)
1347
- response = list_by_resource_group_async(resource_group_name, skip_token:skip_token, custom_headers:custom_headers).value!
1348
- unless response.nil?
1349
- page = response.body
1350
- page.next_method = Proc.new do |next_page_link|
1351
- list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1352
- end
1353
- page
1354
- end
1355
- end
1356
-
1357
- #
1358
- # Lists the access key for the specified configuration store.
1359
- #
1360
- # @param resource_group_name [String] The name of the resource group to which
1361
- # the container registry belongs.
1362
- # @param config_store_name [String] The name of the configuration store.
1363
- # @param skip_token [String] A skip token is used to continue retrieving items
1364
- # after an operation returns a partial result. If a previous response contains
1365
- # a nextLink element, the value of the nextLink element will include a
1366
- # skipToken parameter that specifies a starting point to use for subsequent
1367
- # calls.
1368
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1369
- # will be added to the HTTP request.
1370
- #
1371
- # @return [ApiKeyListResult] which provide lazy access to pages of the
1372
- # response.
1373
- #
1374
- def list_keys_as_lazy(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
1375
- response = list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
1376
- unless response.nil?
1377
- page = response.body
1378
- page.next_method = Proc.new do |next_page_link|
1379
- list_keys_next_async(next_page_link, custom_headers:custom_headers)
1380
- end
1381
- page
1382
- end
1383
- end
1384
-
1385
- end
1386
- end
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Appconfiguration::Mgmt::V2019_02_01_preview
7
+ #
8
+ # ConfigurationStores
9
+ #
10
+ class ConfigurationStores
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ConfigurationStores class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AppConfigurationManagementClient] reference to the AppConfigurationManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the configuration stores for a given subscription.
26
+ #
27
+ # @param skip_token [String] A skip token is used to continue retrieving items
28
+ # after an operation returns a partial result. If a previous response contains
29
+ # a nextLink element, the value of the nextLink element will include a
30
+ # skipToken parameter that specifies a starting point to use for subsequent
31
+ # calls.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Array<ConfigurationStore>] operation results.
36
+ #
37
+ def list(skip_token:nil, custom_headers:nil)
38
+ first_page = list_as_lazy(skip_token:skip_token, custom_headers:custom_headers)
39
+ first_page.get_all_items
40
+ end
41
+
42
+ #
43
+ # Lists the configuration stores for a given subscription.
44
+ #
45
+ # @param skip_token [String] A skip token is used to continue retrieving items
46
+ # after an operation returns a partial result. If a previous response contains
47
+ # a nextLink element, the value of the nextLink element will include a
48
+ # skipToken parameter that specifies a starting point to use for subsequent
49
+ # calls.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(skip_token:nil, custom_headers:nil)
56
+ list_async(skip_token:skip_token, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Lists the configuration stores for a given subscription.
61
+ #
62
+ # @param skip_token [String] A skip token is used to continue retrieving items
63
+ # after an operation returns a partial result. If a previous response contains
64
+ # a nextLink element, the value of the nextLink element will include a
65
+ # skipToken parameter that specifies a starting point to use for subsequent
66
+ # calls.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(skip_token:nil, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
107
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Lists the configuration stores for a given resource group.
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group to which
129
+ # the container registry belongs.
130
+ # @param skip_token [String] A skip token is used to continue retrieving items
131
+ # after an operation returns a partial result. If a previous response contains
132
+ # a nextLink element, the value of the nextLink element will include a
133
+ # skipToken parameter that specifies a starting point to use for subsequent
134
+ # calls.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [Array<ConfigurationStore>] operation results.
139
+ #
140
+ def list_by_resource_group(resource_group_name, skip_token:nil, custom_headers:nil)
141
+ first_page = list_by_resource_group_as_lazy(resource_group_name, skip_token:skip_token, custom_headers:custom_headers)
142
+ first_page.get_all_items
143
+ end
144
+
145
+ #
146
+ # Lists the configuration stores for a given resource group.
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group to which
149
+ # the container registry belongs.
150
+ # @param skip_token [String] A skip token is used to continue retrieving items
151
+ # after an operation returns a partial result. If a previous response contains
152
+ # a nextLink element, the value of the nextLink element will include a
153
+ # skipToken parameter that specifies a starting point to use for subsequent
154
+ # calls.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def list_by_resource_group_with_http_info(resource_group_name, skip_token:nil, custom_headers:nil)
161
+ list_by_resource_group_async(resource_group_name, skip_token:skip_token, custom_headers:custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Lists the configuration stores for a given resource group.
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group to which
168
+ # the container registry belongs.
169
+ # @param skip_token [String] A skip token is used to continue retrieving items
170
+ # after an operation returns a partial result. If a previous response contains
171
+ # a nextLink element, the value of the nextLink element will include a
172
+ # skipToken parameter that specifies a starting point to use for subsequent
173
+ # calls.
174
+ # @param [Hash{String => String}] A hash of custom headers that will be added
175
+ # to the HTTP request.
176
+ #
177
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
178
+ #
179
+ def list_by_resource_group_async(resource_group_name, skip_token:nil, custom_headers:nil)
180
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
181
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
182
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
183
+
184
+
185
+ request_headers = {}
186
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
187
+
188
+ # Set Headers
189
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
190
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
191
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores'
192
+
193
+ request_url = @base_url || @client.base_url
194
+
195
+ options = {
196
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
197
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
198
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
199
+ headers: request_headers.merge(custom_headers || {}),
200
+ base_url: request_url
201
+ }
202
+ promise = @client.make_request_async(:get, path_template, options)
203
+
204
+ promise = promise.then do |result|
205
+ http_response = result.response
206
+ status_code = http_response.status
207
+ response_content = http_response.body
208
+ unless status_code == 200
209
+ error_model = JSON.load(response_content)
210
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
211
+ end
212
+
213
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
214
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
215
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
216
+ # Deserialize Response
217
+ if status_code == 200
218
+ begin
219
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
220
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
221
+ result.body = @client.deserialize(result_mapper, parsed_response)
222
+ rescue Exception => e
223
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
224
+ end
225
+ end
226
+
227
+ result
228
+ end
229
+
230
+ promise.execute
231
+ end
232
+
233
+ #
234
+ # Gets the properties of the specified configuration store.
235
+ #
236
+ # @param resource_group_name [String] The name of the resource group to which
237
+ # the container registry belongs.
238
+ # @param config_store_name [String] The name of the configuration store.
239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
+ # will be added to the HTTP request.
241
+ #
242
+ # @return [ConfigurationStore] operation results.
243
+ #
244
+ def get(resource_group_name, config_store_name, custom_headers:nil)
245
+ response = get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
246
+ response.body unless response.nil?
247
+ end
248
+
249
+ #
250
+ # Gets the properties of the specified configuration store.
251
+ #
252
+ # @param resource_group_name [String] The name of the resource group to which
253
+ # the container registry belongs.
254
+ # @param config_store_name [String] The name of the configuration store.
255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
+ # will be added to the HTTP request.
257
+ #
258
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
+ #
260
+ def get_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
261
+ get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
262
+ end
263
+
264
+ #
265
+ # Gets the properties of the specified configuration store.
266
+ #
267
+ # @param resource_group_name [String] The name of the resource group to which
268
+ # the container registry belongs.
269
+ # @param config_store_name [String] The name of the configuration store.
270
+ # @param [Hash{String => String}] A hash of custom headers that will be added
271
+ # to the HTTP request.
272
+ #
273
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
274
+ #
275
+ def get_async(resource_group_name, config_store_name, custom_headers:nil)
276
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
279
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
280
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
281
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
282
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
283
+
284
+
285
+ request_headers = {}
286
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
287
+
288
+ # Set Headers
289
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
290
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
291
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
292
+
293
+ request_url = @base_url || @client.base_url
294
+
295
+ options = {
296
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
297
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
298
+ query_params: {'api-version' => @client.api_version},
299
+ headers: request_headers.merge(custom_headers || {}),
300
+ base_url: request_url
301
+ }
302
+ promise = @client.make_request_async(:get, path_template, options)
303
+
304
+ promise = promise.then do |result|
305
+ http_response = result.response
306
+ status_code = http_response.status
307
+ response_content = http_response.body
308
+ unless status_code == 200
309
+ error_model = JSON.load(response_content)
310
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
311
+ end
312
+
313
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
314
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
315
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
316
+ # Deserialize Response
317
+ if status_code == 200
318
+ begin
319
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
320
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
321
+ result.body = @client.deserialize(result_mapper, parsed_response)
322
+ rescue Exception => e
323
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
324
+ end
325
+ end
326
+
327
+ result
328
+ end
329
+
330
+ promise.execute
331
+ end
332
+
333
+ #
334
+ # Creates a configuration store with the specified parameters.
335
+ #
336
+ # @param resource_group_name [String] The name of the resource group to which
337
+ # the container registry belongs.
338
+ # @param config_store_name [String] The name of the configuration store.
339
+ # @param config_store_creation_parameters [ConfigurationStore] The parameters
340
+ # for creating a configuration store.
341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
+ # will be added to the HTTP request.
343
+ #
344
+ # @return [ConfigurationStore] operation results.
345
+ #
346
+ def create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
347
+ response = create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
348
+ response.body unless response.nil?
349
+ end
350
+
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group to which
353
+ # the container registry belongs.
354
+ # @param config_store_name [String] The name of the configuration store.
355
+ # @param config_store_creation_parameters [ConfigurationStore] The parameters
356
+ # for creating a configuration store.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [Concurrent::Promise] promise which provides async access to http
361
+ # response.
362
+ #
363
+ def create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
364
+ # Send request
365
+ promise = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers)
366
+
367
+ promise = promise.then do |response|
368
+ # Defining deserialization method.
369
+ deserialize_method = lambda do |parsed_response|
370
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
371
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
372
+ end
373
+
374
+ # Waiting for response.
375
+ @client.get_long_running_operation_result(response, deserialize_method)
376
+ end
377
+
378
+ promise
379
+ end
380
+
381
+ #
382
+ # Deletes a configuration store.
383
+ #
384
+ # @param resource_group_name [String] The name of the resource group to which
385
+ # the container registry belongs.
386
+ # @param config_store_name [String] The name of the configuration store.
387
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
388
+ # will be added to the HTTP request.
389
+ #
390
+ def delete(resource_group_name, config_store_name, custom_headers:nil)
391
+ response = delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
392
+ nil
393
+ end
394
+
395
+ #
396
+ # @param resource_group_name [String] The name of the resource group to which
397
+ # the container registry belongs.
398
+ # @param config_store_name [String] The name of the configuration store.
399
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
+ # will be added to the HTTP request.
401
+ #
402
+ # @return [Concurrent::Promise] promise which provides async access to http
403
+ # response.
404
+ #
405
+ def delete_async(resource_group_name, config_store_name, custom_headers:nil)
406
+ # Send request
407
+ promise = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers)
408
+
409
+ promise = promise.then do |response|
410
+ # Defining deserialization method.
411
+ deserialize_method = lambda do |parsed_response|
412
+ end
413
+
414
+ # Waiting for response.
415
+ @client.get_long_running_operation_result(response, deserialize_method)
416
+ end
417
+
418
+ promise
419
+ end
420
+
421
+ #
422
+ # Updates a configuration store with the specified parameters.
423
+ #
424
+ # @param resource_group_name [String] The name of the resource group to which
425
+ # the container registry belongs.
426
+ # @param config_store_name [String] The name of the configuration store.
427
+ # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
428
+ # The parameters for updating a configuration store.
429
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
430
+ # will be added to the HTTP request.
431
+ #
432
+ # @return [ConfigurationStore] operation results.
433
+ #
434
+ def update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
435
+ response = update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
436
+ response.body unless response.nil?
437
+ end
438
+
439
+ #
440
+ # @param resource_group_name [String] The name of the resource group to which
441
+ # the container registry belongs.
442
+ # @param config_store_name [String] The name of the configuration store.
443
+ # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
444
+ # The parameters for updating a configuration store.
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ # @return [Concurrent::Promise] promise which provides async access to http
449
+ # response.
450
+ #
451
+ def update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
452
+ # Send request
453
+ promise = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers)
454
+
455
+ promise = promise.then do |response|
456
+ # Defining deserialization method.
457
+ deserialize_method = lambda do |parsed_response|
458
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
459
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
460
+ end
461
+
462
+ # Waiting for response.
463
+ @client.get_long_running_operation_result(response, deserialize_method)
464
+ end
465
+
466
+ promise
467
+ end
468
+
469
+ #
470
+ # Lists the access key for the specified configuration store.
471
+ #
472
+ # @param resource_group_name [String] The name of the resource group to which
473
+ # the container registry belongs.
474
+ # @param config_store_name [String] The name of the configuration store.
475
+ # @param skip_token [String] A skip token is used to continue retrieving items
476
+ # after an operation returns a partial result. If a previous response contains
477
+ # a nextLink element, the value of the nextLink element will include a
478
+ # skipToken parameter that specifies a starting point to use for subsequent
479
+ # calls.
480
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
481
+ # will be added to the HTTP request.
482
+ #
483
+ # @return [Array<ApiKey>] operation results.
484
+ #
485
+ def list_keys(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
486
+ first_page = list_keys_as_lazy(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers)
487
+ first_page.get_all_items
488
+ end
489
+
490
+ #
491
+ # Lists the access key for the specified configuration store.
492
+ #
493
+ # @param resource_group_name [String] The name of the resource group to which
494
+ # the container registry belongs.
495
+ # @param config_store_name [String] The name of the configuration store.
496
+ # @param skip_token [String] A skip token is used to continue retrieving items
497
+ # after an operation returns a partial result. If a previous response contains
498
+ # a nextLink element, the value of the nextLink element will include a
499
+ # skipToken parameter that specifies a starting point to use for subsequent
500
+ # calls.
501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
+ # will be added to the HTTP request.
503
+ #
504
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
505
+ #
506
+ def list_keys_with_http_info(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
507
+ list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
508
+ end
509
+
510
+ #
511
+ # Lists the access key for the specified configuration store.
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group to which
514
+ # the container registry belongs.
515
+ # @param config_store_name [String] The name of the configuration store.
516
+ # @param skip_token [String] A skip token is used to continue retrieving items
517
+ # after an operation returns a partial result. If a previous response contains
518
+ # a nextLink element, the value of the nextLink element will include a
519
+ # skipToken parameter that specifies a starting point to use for subsequent
520
+ # calls.
521
+ # @param [Hash{String => String}] A hash of custom headers that will be added
522
+ # to the HTTP request.
523
+ #
524
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
525
+ #
526
+ def list_keys_async(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
527
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
528
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
529
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
530
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
531
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
532
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
533
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
534
+
535
+
536
+ request_headers = {}
537
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
+
539
+ # Set Headers
540
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys'
543
+
544
+ request_url = @base_url || @client.base_url
545
+
546
+ options = {
547
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
548
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
549
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
550
+ headers: request_headers.merge(custom_headers || {}),
551
+ base_url: request_url
552
+ }
553
+ promise = @client.make_request_async(:post, path_template, options)
554
+
555
+ promise = promise.then do |result|
556
+ http_response = result.response
557
+ status_code = http_response.status
558
+ response_content = http_response.body
559
+ unless status_code == 200
560
+ error_model = JSON.load(response_content)
561
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
562
+ end
563
+
564
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
565
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
566
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
567
+ # Deserialize Response
568
+ if status_code == 200
569
+ begin
570
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
571
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKeyListResult.mapper()
572
+ result.body = @client.deserialize(result_mapper, parsed_response)
573
+ rescue Exception => e
574
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
575
+ end
576
+ end
577
+
578
+ result
579
+ end
580
+
581
+ promise.execute
582
+ end
583
+
584
+ #
585
+ # Regenerates an access key for the specified configuration store.
586
+ #
587
+ # @param resource_group_name [String] The name of the resource group to which
588
+ # the container registry belongs.
589
+ # @param config_store_name [String] The name of the configuration store.
590
+ # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
591
+ # regenerating an access key.
592
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
593
+ # will be added to the HTTP request.
594
+ #
595
+ # @return [ApiKey] operation results.
596
+ #
597
+ def regenerate_key(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
598
+ response = regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
599
+ response.body unless response.nil?
600
+ end
601
+
602
+ #
603
+ # Regenerates an access key for the specified configuration store.
604
+ #
605
+ # @param resource_group_name [String] The name of the resource group to which
606
+ # the container registry belongs.
607
+ # @param config_store_name [String] The name of the configuration store.
608
+ # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
609
+ # regenerating an access key.
610
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
611
+ # will be added to the HTTP request.
612
+ #
613
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
614
+ #
615
+ def regenerate_key_with_http_info(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
616
+ regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
617
+ end
618
+
619
+ #
620
+ # Regenerates an access key for the specified configuration store.
621
+ #
622
+ # @param resource_group_name [String] The name of the resource group to which
623
+ # the container registry belongs.
624
+ # @param config_store_name [String] The name of the configuration store.
625
+ # @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for
626
+ # regenerating an access key.
627
+ # @param [Hash{String => String}] A hash of custom headers that will be added
628
+ # to the HTTP request.
629
+ #
630
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
+ #
632
+ def regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
633
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
634
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
635
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
636
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
637
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
638
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
639
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
640
+ fail ArgumentError, 'regenerate_key_parameters is nil' if regenerate_key_parameters.nil?
641
+
642
+
643
+ request_headers = {}
644
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
+
646
+ # Set Headers
647
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
+
650
+ # Serialize Request
651
+ request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::RegenerateKeyParameters.mapper()
652
+ request_content = @client.serialize(request_mapper, regenerate_key_parameters)
653
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
654
+
655
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'
656
+
657
+ request_url = @base_url || @client.base_url
658
+
659
+ options = {
660
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
661
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
662
+ query_params: {'api-version' => @client.api_version},
663
+ body: request_content,
664
+ headers: request_headers.merge(custom_headers || {}),
665
+ base_url: request_url
666
+ }
667
+ promise = @client.make_request_async(:post, path_template, options)
668
+
669
+ promise = promise.then do |result|
670
+ http_response = result.response
671
+ status_code = http_response.status
672
+ response_content = http_response.body
673
+ unless status_code == 200
674
+ error_model = JSON.load(response_content)
675
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
676
+ end
677
+
678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
+ # Deserialize Response
682
+ if status_code == 200
683
+ begin
684
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
685
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKey.mapper()
686
+ result.body = @client.deserialize(result_mapper, parsed_response)
687
+ rescue Exception => e
688
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
689
+ end
690
+ end
691
+
692
+ result
693
+ end
694
+
695
+ promise.execute
696
+ end
697
+
698
+ #
699
+ # Creates a configuration store with the specified parameters.
700
+ #
701
+ # @param resource_group_name [String] The name of the resource group to which
702
+ # the container registry belongs.
703
+ # @param config_store_name [String] The name of the configuration store.
704
+ # @param config_store_creation_parameters [ConfigurationStore] The parameters
705
+ # for creating a configuration store.
706
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
707
+ # will be added to the HTTP request.
708
+ #
709
+ # @return [ConfigurationStore] operation results.
710
+ #
711
+ def begin_create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
712
+ response = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
713
+ response.body unless response.nil?
714
+ end
715
+
716
+ #
717
+ # Creates a configuration store with the specified parameters.
718
+ #
719
+ # @param resource_group_name [String] The name of the resource group to which
720
+ # the container registry belongs.
721
+ # @param config_store_name [String] The name of the configuration store.
722
+ # @param config_store_creation_parameters [ConfigurationStore] The parameters
723
+ # for creating a configuration store.
724
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
725
+ # will be added to the HTTP request.
726
+ #
727
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
728
+ #
729
+ def begin_create_with_http_info(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
730
+ begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
731
+ end
732
+
733
+ #
734
+ # Creates a configuration store with the specified parameters.
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group to which
737
+ # the container registry belongs.
738
+ # @param config_store_name [String] The name of the configuration store.
739
+ # @param config_store_creation_parameters [ConfigurationStore] The parameters
740
+ # for creating a configuration store.
741
+ # @param [Hash{String => String}] A hash of custom headers that will be added
742
+ # to the HTTP request.
743
+ #
744
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
745
+ #
746
+ def begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
747
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
748
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
749
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
750
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
751
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
752
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
753
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
754
+ fail ArgumentError, 'config_store_creation_parameters is nil' if config_store_creation_parameters.nil?
755
+
756
+
757
+ request_headers = {}
758
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
759
+
760
+ # Set Headers
761
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
762
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
763
+
764
+ # Serialize Request
765
+ request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
766
+ request_content = @client.serialize(request_mapper, config_store_creation_parameters)
767
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
768
+
769
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
770
+
771
+ request_url = @base_url || @client.base_url
772
+
773
+ options = {
774
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
775
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
776
+ query_params: {'api-version' => @client.api_version},
777
+ body: request_content,
778
+ headers: request_headers.merge(custom_headers || {}),
779
+ base_url: request_url
780
+ }
781
+ promise = @client.make_request_async(:put, path_template, options)
782
+
783
+ promise = promise.then do |result|
784
+ http_response = result.response
785
+ status_code = http_response.status
786
+ response_content = http_response.body
787
+ unless status_code == 200 || status_code == 201
788
+ error_model = JSON.load(response_content)
789
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
790
+ end
791
+
792
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
793
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
794
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
795
+ # Deserialize Response
796
+ if status_code == 200
797
+ begin
798
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
799
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
800
+ result.body = @client.deserialize(result_mapper, parsed_response)
801
+ rescue Exception => e
802
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
803
+ end
804
+ end
805
+ # Deserialize Response
806
+ if status_code == 201
807
+ begin
808
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
809
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
810
+ result.body = @client.deserialize(result_mapper, parsed_response)
811
+ rescue Exception => e
812
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
813
+ end
814
+ end
815
+
816
+ result
817
+ end
818
+
819
+ promise.execute
820
+ end
821
+
822
+ #
823
+ # Deletes a configuration store.
824
+ #
825
+ # @param resource_group_name [String] The name of the resource group to which
826
+ # the container registry belongs.
827
+ # @param config_store_name [String] The name of the configuration store.
828
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
829
+ # will be added to the HTTP request.
830
+ #
831
+ #
832
+ def begin_delete(resource_group_name, config_store_name, custom_headers:nil)
833
+ response = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
834
+ nil
835
+ end
836
+
837
+ #
838
+ # Deletes a configuration store.
839
+ #
840
+ # @param resource_group_name [String] The name of the resource group to which
841
+ # the container registry belongs.
842
+ # @param config_store_name [String] The name of the configuration store.
843
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
844
+ # will be added to the HTTP request.
845
+ #
846
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
847
+ #
848
+ def begin_delete_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
849
+ begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
850
+ end
851
+
852
+ #
853
+ # Deletes a configuration store.
854
+ #
855
+ # @param resource_group_name [String] The name of the resource group to which
856
+ # the container registry belongs.
857
+ # @param config_store_name [String] The name of the configuration store.
858
+ # @param [Hash{String => String}] A hash of custom headers that will be added
859
+ # to the HTTP request.
860
+ #
861
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
862
+ #
863
+ def begin_delete_async(resource_group_name, config_store_name, custom_headers:nil)
864
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
865
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
866
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
867
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
868
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
869
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
870
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
871
+
872
+
873
+ request_headers = {}
874
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
875
+
876
+ # Set Headers
877
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
878
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
879
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
880
+
881
+ request_url = @base_url || @client.base_url
882
+
883
+ options = {
884
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
885
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
886
+ query_params: {'api-version' => @client.api_version},
887
+ headers: request_headers.merge(custom_headers || {}),
888
+ base_url: request_url
889
+ }
890
+ promise = @client.make_request_async(:delete, path_template, options)
891
+
892
+ promise = promise.then do |result|
893
+ http_response = result.response
894
+ status_code = http_response.status
895
+ response_content = http_response.body
896
+ unless status_code == 200 || status_code == 202 || status_code == 204
897
+ error_model = JSON.load(response_content)
898
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
899
+ end
900
+
901
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
902
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
903
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
904
+
905
+ result
906
+ end
907
+
908
+ promise.execute
909
+ end
910
+
911
+ #
912
+ # Updates a configuration store with the specified parameters.
913
+ #
914
+ # @param resource_group_name [String] The name of the resource group to which
915
+ # the container registry belongs.
916
+ # @param config_store_name [String] The name of the configuration store.
917
+ # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
918
+ # The parameters for updating a configuration store.
919
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
920
+ # will be added to the HTTP request.
921
+ #
922
+ # @return [ConfigurationStore] operation results.
923
+ #
924
+ def begin_update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
925
+ response = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
926
+ response.body unless response.nil?
927
+ end
928
+
929
+ #
930
+ # Updates a configuration store with the specified parameters.
931
+ #
932
+ # @param resource_group_name [String] The name of the resource group to which
933
+ # the container registry belongs.
934
+ # @param config_store_name [String] The name of the configuration store.
935
+ # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
936
+ # The parameters for updating a configuration store.
937
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
938
+ # will be added to the HTTP request.
939
+ #
940
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
941
+ #
942
+ def begin_update_with_http_info(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
943
+ begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
944
+ end
945
+
946
+ #
947
+ # Updates a configuration store with the specified parameters.
948
+ #
949
+ # @param resource_group_name [String] The name of the resource group to which
950
+ # the container registry belongs.
951
+ # @param config_store_name [String] The name of the configuration store.
952
+ # @param config_store_update_parameters [ConfigurationStoreUpdateParameters]
953
+ # The parameters for updating a configuration store.
954
+ # @param [Hash{String => String}] A hash of custom headers that will be added
955
+ # to the HTTP request.
956
+ #
957
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
958
+ #
959
+ def begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
960
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
961
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
962
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
963
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
964
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
965
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
966
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
967
+ fail ArgumentError, 'config_store_update_parameters is nil' if config_store_update_parameters.nil?
968
+
969
+
970
+ request_headers = {}
971
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
972
+
973
+ # Set Headers
974
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
975
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
976
+
977
+ # Serialize Request
978
+ request_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreUpdateParameters.mapper()
979
+ request_content = @client.serialize(request_mapper, config_store_update_parameters)
980
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
981
+
982
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'
983
+
984
+ request_url = @base_url || @client.base_url
985
+
986
+ options = {
987
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
988
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
989
+ query_params: {'api-version' => @client.api_version},
990
+ body: request_content,
991
+ headers: request_headers.merge(custom_headers || {}),
992
+ base_url: request_url
993
+ }
994
+ promise = @client.make_request_async(:patch, path_template, options)
995
+
996
+ promise = promise.then do |result|
997
+ http_response = result.response
998
+ status_code = http_response.status
999
+ response_content = http_response.body
1000
+ unless status_code == 200 || status_code == 201
1001
+ error_model = JSON.load(response_content)
1002
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1003
+ end
1004
+
1005
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1006
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1007
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1008
+ # Deserialize Response
1009
+ if status_code == 200
1010
+ begin
1011
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1012
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
1013
+ result.body = @client.deserialize(result_mapper, parsed_response)
1014
+ rescue Exception => e
1015
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1016
+ end
1017
+ end
1018
+ # Deserialize Response
1019
+ if status_code == 201
1020
+ begin
1021
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1022
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStore.mapper()
1023
+ result.body = @client.deserialize(result_mapper, parsed_response)
1024
+ rescue Exception => e
1025
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1026
+ end
1027
+ end
1028
+
1029
+ result
1030
+ end
1031
+
1032
+ promise.execute
1033
+ end
1034
+
1035
+ #
1036
+ # Lists the configuration stores for a given subscription.
1037
+ #
1038
+ # @param next_page_link [String] The NextLink from the previous successful call
1039
+ # to List operation.
1040
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1041
+ # will be added to the HTTP request.
1042
+ #
1043
+ # @return [ConfigurationStoreListResult] operation results.
1044
+ #
1045
+ def list_next(next_page_link, custom_headers:nil)
1046
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1047
+ response.body unless response.nil?
1048
+ end
1049
+
1050
+ #
1051
+ # Lists the configuration stores for a given subscription.
1052
+ #
1053
+ # @param next_page_link [String] The NextLink from the previous successful call
1054
+ # to List operation.
1055
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1056
+ # will be added to the HTTP request.
1057
+ #
1058
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1059
+ #
1060
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1061
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1062
+ end
1063
+
1064
+ #
1065
+ # Lists the configuration stores for a given subscription.
1066
+ #
1067
+ # @param next_page_link [String] The NextLink from the previous successful call
1068
+ # to List operation.
1069
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1070
+ # to the HTTP request.
1071
+ #
1072
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1073
+ #
1074
+ def list_next_async(next_page_link, custom_headers:nil)
1075
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1076
+
1077
+
1078
+ request_headers = {}
1079
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1080
+
1081
+ # Set Headers
1082
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1083
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1084
+ path_template = '{nextLink}'
1085
+
1086
+ request_url = @base_url || @client.base_url
1087
+
1088
+ options = {
1089
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1090
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1091
+ headers: request_headers.merge(custom_headers || {}),
1092
+ base_url: request_url
1093
+ }
1094
+ promise = @client.make_request_async(:get, path_template, options)
1095
+
1096
+ promise = promise.then do |result|
1097
+ http_response = result.response
1098
+ status_code = http_response.status
1099
+ response_content = http_response.body
1100
+ unless status_code == 200
1101
+ error_model = JSON.load(response_content)
1102
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1103
+ end
1104
+
1105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1106
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1107
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1108
+ # Deserialize Response
1109
+ if status_code == 200
1110
+ begin
1111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1112
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
1113
+ result.body = @client.deserialize(result_mapper, parsed_response)
1114
+ rescue Exception => e
1115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1116
+ end
1117
+ end
1118
+
1119
+ result
1120
+ end
1121
+
1122
+ promise.execute
1123
+ end
1124
+
1125
+ #
1126
+ # Lists the configuration stores for a given resource group.
1127
+ #
1128
+ # @param next_page_link [String] The NextLink from the previous successful call
1129
+ # to List operation.
1130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1131
+ # will be added to the HTTP request.
1132
+ #
1133
+ # @return [ConfigurationStoreListResult] operation results.
1134
+ #
1135
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1136
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1137
+ response.body unless response.nil?
1138
+ end
1139
+
1140
+ #
1141
+ # Lists the configuration stores for a given resource group.
1142
+ #
1143
+ # @param next_page_link [String] The NextLink from the previous successful call
1144
+ # to List operation.
1145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1146
+ # will be added to the HTTP request.
1147
+ #
1148
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1149
+ #
1150
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1151
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1152
+ end
1153
+
1154
+ #
1155
+ # Lists the configuration stores for a given resource group.
1156
+ #
1157
+ # @param next_page_link [String] The NextLink from the previous successful call
1158
+ # to List operation.
1159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1160
+ # to the HTTP request.
1161
+ #
1162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1163
+ #
1164
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1165
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1166
+
1167
+
1168
+ request_headers = {}
1169
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1170
+
1171
+ # Set Headers
1172
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1174
+ path_template = '{nextLink}'
1175
+
1176
+ request_url = @base_url || @client.base_url
1177
+
1178
+ options = {
1179
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1180
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1181
+ headers: request_headers.merge(custom_headers || {}),
1182
+ base_url: request_url
1183
+ }
1184
+ promise = @client.make_request_async(:get, path_template, options)
1185
+
1186
+ promise = promise.then do |result|
1187
+ http_response = result.response
1188
+ status_code = http_response.status
1189
+ response_content = http_response.body
1190
+ unless status_code == 200
1191
+ error_model = JSON.load(response_content)
1192
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1193
+ end
1194
+
1195
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1196
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1197
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1198
+ # Deserialize Response
1199
+ if status_code == 200
1200
+ begin
1201
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1202
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ConfigurationStoreListResult.mapper()
1203
+ result.body = @client.deserialize(result_mapper, parsed_response)
1204
+ rescue Exception => e
1205
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1206
+ end
1207
+ end
1208
+
1209
+ result
1210
+ end
1211
+
1212
+ promise.execute
1213
+ end
1214
+
1215
+ #
1216
+ # Lists the access key for the specified configuration store.
1217
+ #
1218
+ # @param next_page_link [String] The NextLink from the previous successful call
1219
+ # to List operation.
1220
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1221
+ # will be added to the HTTP request.
1222
+ #
1223
+ # @return [ApiKeyListResult] operation results.
1224
+ #
1225
+ def list_keys_next(next_page_link, custom_headers:nil)
1226
+ response = list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
1227
+ response.body unless response.nil?
1228
+ end
1229
+
1230
+ #
1231
+ # Lists the access key for the specified configuration store.
1232
+ #
1233
+ # @param next_page_link [String] The NextLink from the previous successful call
1234
+ # to List operation.
1235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1236
+ # will be added to the HTTP request.
1237
+ #
1238
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1239
+ #
1240
+ def list_keys_next_with_http_info(next_page_link, custom_headers:nil)
1241
+ list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
1242
+ end
1243
+
1244
+ #
1245
+ # Lists the access key for the specified configuration store.
1246
+ #
1247
+ # @param next_page_link [String] The NextLink from the previous successful call
1248
+ # to List operation.
1249
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1250
+ # to the HTTP request.
1251
+ #
1252
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1253
+ #
1254
+ def list_keys_next_async(next_page_link, custom_headers:nil)
1255
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1256
+
1257
+
1258
+ request_headers = {}
1259
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1260
+
1261
+ # Set Headers
1262
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1263
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1264
+ path_template = '{nextLink}'
1265
+
1266
+ request_url = @base_url || @client.base_url
1267
+
1268
+ options = {
1269
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1270
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1271
+ headers: request_headers.merge(custom_headers || {}),
1272
+ base_url: request_url
1273
+ }
1274
+ promise = @client.make_request_async(:post, path_template, options)
1275
+
1276
+ promise = promise.then do |result|
1277
+ http_response = result.response
1278
+ status_code = http_response.status
1279
+ response_content = http_response.body
1280
+ unless status_code == 200
1281
+ error_model = JSON.load(response_content)
1282
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1283
+ end
1284
+
1285
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1286
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1287
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1288
+ # Deserialize Response
1289
+ if status_code == 200
1290
+ begin
1291
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1292
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_02_01_preview::Models::ApiKeyListResult.mapper()
1293
+ result.body = @client.deserialize(result_mapper, parsed_response)
1294
+ rescue Exception => e
1295
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1296
+ end
1297
+ end
1298
+
1299
+ result
1300
+ end
1301
+
1302
+ promise.execute
1303
+ end
1304
+
1305
+ #
1306
+ # Lists the configuration stores for a given subscription.
1307
+ #
1308
+ # @param skip_token [String] A skip token is used to continue retrieving items
1309
+ # after an operation returns a partial result. If a previous response contains
1310
+ # a nextLink element, the value of the nextLink element will include a
1311
+ # skipToken parameter that specifies a starting point to use for subsequent
1312
+ # calls.
1313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1314
+ # will be added to the HTTP request.
1315
+ #
1316
+ # @return [ConfigurationStoreListResult] which provide lazy access to pages of
1317
+ # the response.
1318
+ #
1319
+ def list_as_lazy(skip_token:nil, custom_headers:nil)
1320
+ response = list_async(skip_token:skip_token, custom_headers:custom_headers).value!
1321
+ unless response.nil?
1322
+ page = response.body
1323
+ page.next_method = Proc.new do |next_page_link|
1324
+ list_next_async(next_page_link, custom_headers:custom_headers)
1325
+ end
1326
+ page
1327
+ end
1328
+ end
1329
+
1330
+ #
1331
+ # Lists the configuration stores for a given resource group.
1332
+ #
1333
+ # @param resource_group_name [String] The name of the resource group to which
1334
+ # the container registry belongs.
1335
+ # @param skip_token [String] A skip token is used to continue retrieving items
1336
+ # after an operation returns a partial result. If a previous response contains
1337
+ # a nextLink element, the value of the nextLink element will include a
1338
+ # skipToken parameter that specifies a starting point to use for subsequent
1339
+ # calls.
1340
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1341
+ # will be added to the HTTP request.
1342
+ #
1343
+ # @return [ConfigurationStoreListResult] which provide lazy access to pages of
1344
+ # the response.
1345
+ #
1346
+ def list_by_resource_group_as_lazy(resource_group_name, skip_token:nil, custom_headers:nil)
1347
+ response = list_by_resource_group_async(resource_group_name, skip_token:skip_token, custom_headers:custom_headers).value!
1348
+ unless response.nil?
1349
+ page = response.body
1350
+ page.next_method = Proc.new do |next_page_link|
1351
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1352
+ end
1353
+ page
1354
+ end
1355
+ end
1356
+
1357
+ #
1358
+ # Lists the access key for the specified configuration store.
1359
+ #
1360
+ # @param resource_group_name [String] The name of the resource group to which
1361
+ # the container registry belongs.
1362
+ # @param config_store_name [String] The name of the configuration store.
1363
+ # @param skip_token [String] A skip token is used to continue retrieving items
1364
+ # after an operation returns a partial result. If a previous response contains
1365
+ # a nextLink element, the value of the nextLink element will include a
1366
+ # skipToken parameter that specifies a starting point to use for subsequent
1367
+ # calls.
1368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1369
+ # will be added to the HTTP request.
1370
+ #
1371
+ # @return [ApiKeyListResult] which provide lazy access to pages of the
1372
+ # response.
1373
+ #
1374
+ def list_keys_as_lazy(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
1375
+ response = list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
1376
+ unless response.nil?
1377
+ page = response.body
1378
+ page.next_method = Proc.new do |next_page_link|
1379
+ list_keys_next_async(next_page_link, custom_headers:custom_headers)
1380
+ end
1381
+ page
1382
+ end
1383
+ end
1384
+
1385
+ end
1386
+ end