azure_mgmt_service_fabric 0.15.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +52 -45
  3. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +63 -59
  4. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +1 -1
  5. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +1 -1
  6. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +1 -1
  7. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/resource.rb +9 -0
  8. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +16 -14
  9. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +10 -6
  10. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
  11. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
  12. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
  13. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
  14. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
  15. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
  16. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
  17. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
  18. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
  19. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
  20. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
  21. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
  22. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
  23. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
  24. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  25. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  26. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  27. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  28. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  29. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
  30. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  31. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  32. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
  33. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  34. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
  35. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
  36. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  37. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  38. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  39. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  40. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
  41. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
  42. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
  43. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  44. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  45. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
  46. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  47. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
  48. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +110 -0
  49. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
  50. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
  51. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
  52. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
  53. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
  54. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
  55. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
  56. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
  57. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
  58. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
  59. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
  60. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
  61. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
  62. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  63. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  64. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
  65. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
  66. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
  67. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
  68. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
  69. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
  70. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
  71. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
  72. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  73. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
  74. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
  75. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +148 -0
  76. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
  77. data/lib/2018-02-01/generated/azure_mgmt_service_fabric.rb +61 -0
  78. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +456 -0
  79. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/clusters.rb +753 -0
  80. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/application_delta_health_policy.rb +73 -0
  81. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +71 -0
  82. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  83. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  84. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  85. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  86. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  87. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster.rb +476 -0
  88. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  89. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  90. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +121 -0
  91. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  92. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +276 -0
  93. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +125 -0
  94. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  95. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  96. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  97. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  98. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/error_model.rb +47 -0
  99. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/error_model_error.rb +57 -0
  100. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/node_type_description.rb +198 -0
  101. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  102. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  103. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  104. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/resource.rb +110 -0
  105. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_name.rb +57 -0
  106. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_names.rb +71 -0
  107. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +60 -0
  108. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +55 -0
  109. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  110. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  111. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  112. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/operations.rb +237 -0
  113. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +141 -0
  114. data/lib/azure_mgmt_service_fabric.rb +2 -0
  115. data/lib/profiles/latest/modules/servicefabric_profile_module.rb +293 -114
  116. data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
  117. data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
  118. data/lib/version.rb +1 -1
  119. metadata +109 -5
@@ -0,0 +1,148 @@
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::ServiceFabric::Mgmt::V2017_07_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ServiceFabricManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The preferred language for the response.
21
+ attr_accessor :accept_language
22
+
23
+ # @return [Integer] The retry timeout in seconds for Long Running
24
+ # Operations. Default value is 30.
25
+ attr_accessor :long_running_operation_retry_timeout
26
+
27
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
28
+ # generated. When set to true a unique x-ms-client-request-id value is
29
+ # generated and included in each request. Default is true.
30
+ attr_accessor :generate_client_request_id
31
+
32
+ # @return [Clusters] clusters
33
+ attr_reader :clusters
34
+
35
+ # @return [ClusterVersions] cluster_versions
36
+ attr_reader :cluster_versions
37
+
38
+ # @return [Operations] operations
39
+ attr_reader :operations
40
+
41
+ # @return [ApplicationType] application_type
42
+ attr_reader :application_type
43
+
44
+ # @return [Version] version
45
+ attr_reader :version
46
+
47
+ # @return [Application] application
48
+ attr_reader :application
49
+
50
+ # @return [Service] service
51
+ attr_reader :service
52
+
53
+ #
54
+ # Creates initializes a new instance of the ServiceFabricManagementClient class.
55
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
56
+ # @param base_url [String] the base URI of the service.
57
+ # @param options [Array] filters to be applied to the HTTP requests.
58
+ #
59
+ def initialize(credentials = nil, base_url = nil, options = nil)
60
+ super(credentials, options)
61
+ @base_url = base_url || 'https://management.azure.com'
62
+
63
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
64
+ @credentials = credentials
65
+
66
+ @clusters = Clusters.new(self)
67
+ @cluster_versions = ClusterVersions.new(self)
68
+ @operations = Operations.new(self)
69
+ @application_type = ApplicationType.new(self)
70
+ @version = Version.new(self)
71
+ @application = Application.new(self)
72
+ @service = Service.new(self)
73
+ @accept_language = 'en-US'
74
+ @long_running_operation_retry_timeout = 30
75
+ @generate_client_request_id = true
76
+ add_telemetry
77
+ end
78
+
79
+ #
80
+ # Makes a request and returns the body of the response.
81
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
82
+ # @param path [String] the path, relative to {base_url}.
83
+ # @param options [Hash{String=>String}] specifying any request options like :body.
84
+ # @return [Hash{String=>String}] containing the body of the response.
85
+ # Example:
86
+ #
87
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
88
+ # path = "/path"
89
+ # options = {
90
+ # body: request_content,
91
+ # query_params: {'api-version' => '2016-02-01'}
92
+ # }
93
+ # result = @client.make_request(:put, path, options)
94
+ #
95
+ def make_request(method, path, options = {})
96
+ result = make_request_with_http_info(method, path, options)
97
+ result.body unless result.nil?
98
+ end
99
+
100
+ #
101
+ # Makes a request and returns the operation response.
102
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
103
+ # @param path [String] the path, relative to {base_url}.
104
+ # @param options [Hash{String=>String}] specifying any request options like :body.
105
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
106
+ #
107
+ def make_request_with_http_info(method, path, options = {})
108
+ result = make_request_async(method, path, options).value!
109
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
110
+ result
111
+ end
112
+
113
+ #
114
+ # Makes a request asynchronously.
115
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
116
+ # @param path [String] the path, relative to {base_url}.
117
+ # @param options [Hash{String=>String}] specifying any request options like :body.
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def make_request_async(method, path, options = {})
121
+ fail ArgumentError, 'method is nil' if method.nil?
122
+ fail ArgumentError, 'path is nil' if path.nil?
123
+
124
+ request_url = options[:base_url] || @base_url
125
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
126
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
127
+ end
128
+
129
+ request_headers = @request_headers
130
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
131
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
132
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
133
+
134
+ super(request_url, method, path, options)
135
+ end
136
+
137
+
138
+ private
139
+ #
140
+ # Adds telemetry information.
141
+ #
142
+ def add_telemetry
143
+ sdk_information = 'azure_mgmt_service_fabric'
144
+ sdk_information = "#{sdk_information}/0.17.3"
145
+ add_user_agent_information(sdk_information)
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,559 @@
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::ServiceFabric::Mgmt::V2017_07_01_preview
7
+ #
8
+ # Service Fabric Management Client
9
+ #
10
+ class Version
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Version class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceFabricManagementClient] reference to the ServiceFabricManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Returns an application type version resource.
26
+ #
27
+ # @param subscription_id [String] The customer subscription identifier
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param cluster_name [String] The name of the cluster resource
30
+ # @param application_type_name [String] The name of the application type name
31
+ # resource
32
+ # @param version [String] The application type version.
33
+ # @param api_version [String] The version of the API.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [VersionResource] operation results.
38
+ #
39
+ def get(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
40
+ response = get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Returns an application type version resource.
46
+ #
47
+ # @param subscription_id [String] The customer subscription identifier
48
+ # @param resource_group_name [String] The name of the resource group.
49
+ # @param cluster_name [String] The name of the cluster resource
50
+ # @param application_type_name [String] The name of the application type name
51
+ # resource
52
+ # @param version [String] The application type version.
53
+ # @param api_version [String] The version of the API.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def get_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
60
+ get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Returns an application type version resource.
65
+ #
66
+ # @param subscription_id [String] The customer subscription identifier
67
+ # @param resource_group_name [String] The name of the resource group.
68
+ # @param cluster_name [String] The name of the cluster resource
69
+ # @param application_type_name [String] The name of the application type name
70
+ # resource
71
+ # @param version [String] The application type version.
72
+ # @param api_version [String] The version of the API.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
79
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
82
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
83
+ fail ArgumentError, 'version is nil' if version.nil?
84
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
100
+ query_params: {'api-version' => api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ # Deserialize Response
117
+ if status_code == 200
118
+ begin
119
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
120
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
121
+ result.body = @client.deserialize(result_mapper, parsed_response)
122
+ rescue Exception => e
123
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
124
+ end
125
+ end
126
+
127
+ result
128
+ end
129
+
130
+ promise.execute
131
+ end
132
+
133
+ #
134
+ # Provisions an application type version resource.
135
+ #
136
+ # @param subscription_id [String] The customer subscription identifier
137
+ # @param resource_group_name [String] The name of the resource group.
138
+ # @param cluster_name [String] The name of the cluster resource
139
+ # @param application_type_name [String] The name of the application type name
140
+ # resource
141
+ # @param version [String] The application type version.
142
+ # @param api_version [String] The version of the API.
143
+ # @param parameters [VersionResource] The application type version resource.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [VersionResource] operation results.
148
+ #
149
+ def put(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
150
+ response = put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # @param subscription_id [String] The customer subscription identifier
156
+ # @param resource_group_name [String] The name of the resource group.
157
+ # @param cluster_name [String] The name of the cluster resource
158
+ # @param application_type_name [String] The name of the application type name
159
+ # resource
160
+ # @param version [String] The application type version.
161
+ # @param api_version [String] The version of the API.
162
+ # @param parameters [VersionResource] The application type version resource.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [Concurrent::Promise] promise which provides async access to http
167
+ # response.
168
+ #
169
+ def put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
170
+ # Send request
171
+ promise = begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers)
172
+
173
+ promise = promise.then do |response|
174
+ # Defining deserialization method.
175
+ deserialize_method = lambda do |parsed_response|
176
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
177
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
178
+ end
179
+
180
+ # Waiting for response.
181
+ @client.get_long_running_operation_result(response, deserialize_method)
182
+ end
183
+
184
+ promise
185
+ end
186
+
187
+ #
188
+ # Unprovisions an application type version resource.
189
+ #
190
+ # @param subscription_id [String] The customer subscription identifier
191
+ # @param resource_group_name [String] The name of the resource group.
192
+ # @param cluster_name [String] The name of the cluster resource
193
+ # @param application_type_name [String] The name of the application type name
194
+ # resource
195
+ # @param version [String] The application type version.
196
+ # @param api_version [String] The version of the API.
197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
198
+ # will be added to the HTTP request.
199
+ #
200
+ def delete(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
201
+ response = delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
202
+ nil
203
+ end
204
+
205
+ #
206
+ # @param subscription_id [String] The customer subscription identifier
207
+ # @param resource_group_name [String] The name of the resource group.
208
+ # @param cluster_name [String] The name of the cluster resource
209
+ # @param application_type_name [String] The name of the application type name
210
+ # resource
211
+ # @param version [String] The application type version.
212
+ # @param api_version [String] The version of the API.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [Concurrent::Promise] promise which provides async access to http
217
+ # response.
218
+ #
219
+ def delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
220
+ # Send request
221
+ promise = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers)
222
+
223
+ promise = promise.then do |response|
224
+ # Defining deserialization method.
225
+ deserialize_method = lambda do |parsed_response|
226
+ end
227
+
228
+ # Waiting for response.
229
+ @client.get_long_running_operation_result(response, deserialize_method)
230
+ end
231
+
232
+ promise
233
+ end
234
+
235
+ #
236
+ # Returns all versions for the specified application type.
237
+ #
238
+ # @param subscription_id [String] The customer subscription identifier
239
+ # @param resource_group_name [String] The name of the resource group.
240
+ # @param cluster_name [String] The name of the cluster resource
241
+ # @param application_type_name [String] The name of the application type name
242
+ # resource
243
+ # @param api_version [String] The version of the API.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [VersionResourceList] operation results.
248
+ #
249
+ def list(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
250
+ response = list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:custom_headers).value!
251
+ response.body unless response.nil?
252
+ end
253
+
254
+ #
255
+ # Returns all versions for the specified application type.
256
+ #
257
+ # @param subscription_id [String] The customer subscription identifier
258
+ # @param resource_group_name [String] The name of the resource group.
259
+ # @param cluster_name [String] The name of the cluster resource
260
+ # @param application_type_name [String] The name of the application type name
261
+ # resource
262
+ # @param api_version [String] The version of the API.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
267
+ #
268
+ def list_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
269
+ list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:custom_headers).value!
270
+ end
271
+
272
+ #
273
+ # Returns all versions for the specified application type.
274
+ #
275
+ # @param subscription_id [String] The customer subscription identifier
276
+ # @param resource_group_name [String] The name of the resource group.
277
+ # @param cluster_name [String] The name of the cluster resource
278
+ # @param application_type_name [String] The name of the application type name
279
+ # resource
280
+ # @param api_version [String] The version of the API.
281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
282
+ # to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
+ #
286
+ def list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
287
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
288
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
289
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
290
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
291
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
292
+
293
+
294
+ request_headers = {}
295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
296
+
297
+ # Set Headers
298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
300
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions'
301
+
302
+ request_url = @base_url || @client.base_url
303
+
304
+ options = {
305
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
306
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name},
307
+ query_params: {'api-version' => api_version},
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
310
+ }
311
+ promise = @client.make_request_async(:get, path_template, options)
312
+
313
+ promise = promise.then do |result|
314
+ http_response = result.response
315
+ status_code = http_response.status
316
+ response_content = http_response.body
317
+ unless status_code == 200
318
+ error_model = JSON.load(response_content)
319
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
320
+ end
321
+
322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
323
+ # Deserialize Response
324
+ if status_code == 200
325
+ begin
326
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
327
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResourceList.mapper()
328
+ result.body = @client.deserialize(result_mapper, parsed_response)
329
+ rescue Exception => e
330
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
331
+ end
332
+ end
333
+
334
+ result
335
+ end
336
+
337
+ promise.execute
338
+ end
339
+
340
+ #
341
+ # Provisions an application type version resource.
342
+ #
343
+ # @param subscription_id [String] The customer subscription identifier
344
+ # @param resource_group_name [String] The name of the resource group.
345
+ # @param cluster_name [String] The name of the cluster resource
346
+ # @param application_type_name [String] The name of the application type name
347
+ # resource
348
+ # @param version [String] The application type version.
349
+ # @param api_version [String] The version of the API.
350
+ # @param parameters [VersionResource] The application type version resource.
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ # @return [VersionResource] operation results.
355
+ #
356
+ def begin_put(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
357
+ response = begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
358
+ response.body unless response.nil?
359
+ end
360
+
361
+ #
362
+ # Provisions an application type version resource.
363
+ #
364
+ # @param subscription_id [String] The customer subscription identifier
365
+ # @param resource_group_name [String] The name of the resource group.
366
+ # @param cluster_name [String] The name of the cluster resource
367
+ # @param application_type_name [String] The name of the application type name
368
+ # resource
369
+ # @param version [String] The application type version.
370
+ # @param api_version [String] The version of the API.
371
+ # @param parameters [VersionResource] The application type version resource.
372
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
+ # will be added to the HTTP request.
374
+ #
375
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
376
+ #
377
+ def begin_put_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
378
+ begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
379
+ end
380
+
381
+ #
382
+ # Provisions an application type version resource.
383
+ #
384
+ # @param subscription_id [String] The customer subscription identifier
385
+ # @param resource_group_name [String] The name of the resource group.
386
+ # @param cluster_name [String] The name of the cluster resource
387
+ # @param application_type_name [String] The name of the application type name
388
+ # resource
389
+ # @param version [String] The application type version.
390
+ # @param api_version [String] The version of the API.
391
+ # @param parameters [VersionResource] The application type version resource.
392
+ # @param [Hash{String => String}] A hash of custom headers that will be added
393
+ # to the HTTP request.
394
+ #
395
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
396
+ #
397
+ def begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
398
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
399
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
400
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
401
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
402
+ fail ArgumentError, 'version is nil' if version.nil?
403
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
404
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
405
+
406
+
407
+ request_headers = {}
408
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
409
+
410
+ # Set Headers
411
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
412
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
413
+
414
+ # Serialize Request
415
+ request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
416
+ request_content = @client.serialize(request_mapper, parameters)
417
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
418
+
419
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
420
+
421
+ request_url = @base_url || @client.base_url
422
+
423
+ options = {
424
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
425
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
426
+ query_params: {'api-version' => api_version},
427
+ body: request_content,
428
+ headers: request_headers.merge(custom_headers || {}),
429
+ base_url: request_url
430
+ }
431
+ promise = @client.make_request_async(:put, path_template, options)
432
+
433
+ promise = promise.then do |result|
434
+ http_response = result.response
435
+ status_code = http_response.status
436
+ response_content = http_response.body
437
+ unless status_code == 202
438
+ error_model = JSON.load(response_content)
439
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
440
+ end
441
+
442
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
443
+ # Deserialize Response
444
+ if status_code == 202
445
+ begin
446
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
447
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
448
+ result.body = @client.deserialize(result_mapper, parsed_response)
449
+ rescue Exception => e
450
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
451
+ end
452
+ end
453
+
454
+ result
455
+ end
456
+
457
+ promise.execute
458
+ end
459
+
460
+ #
461
+ # Unprovisions an application type version resource.
462
+ #
463
+ # @param subscription_id [String] The customer subscription identifier
464
+ # @param resource_group_name [String] The name of the resource group.
465
+ # @param cluster_name [String] The name of the cluster resource
466
+ # @param application_type_name [String] The name of the application type name
467
+ # resource
468
+ # @param version [String] The application type version.
469
+ # @param api_version [String] The version of the API.
470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
471
+ # will be added to the HTTP request.
472
+ #
473
+ #
474
+ def begin_delete(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
475
+ response = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
476
+ nil
477
+ end
478
+
479
+ #
480
+ # Unprovisions an application type version resource.
481
+ #
482
+ # @param subscription_id [String] The customer subscription identifier
483
+ # @param resource_group_name [String] The name of the resource group.
484
+ # @param cluster_name [String] The name of the cluster resource
485
+ # @param application_type_name [String] The name of the application type name
486
+ # resource
487
+ # @param version [String] The application type version.
488
+ # @param api_version [String] The version of the API.
489
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
490
+ # will be added to the HTTP request.
491
+ #
492
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
493
+ #
494
+ def begin_delete_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
495
+ begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
496
+ end
497
+
498
+ #
499
+ # Unprovisions an application type version resource.
500
+ #
501
+ # @param subscription_id [String] The customer subscription identifier
502
+ # @param resource_group_name [String] The name of the resource group.
503
+ # @param cluster_name [String] The name of the cluster resource
504
+ # @param application_type_name [String] The name of the application type name
505
+ # resource
506
+ # @param version [String] The application type version.
507
+ # @param api_version [String] The version of the API.
508
+ # @param [Hash{String => String}] A hash of custom headers that will be added
509
+ # to the HTTP request.
510
+ #
511
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
512
+ #
513
+ def begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
514
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
515
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
516
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
517
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
518
+ fail ArgumentError, 'version is nil' if version.nil?
519
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
520
+
521
+
522
+ request_headers = {}
523
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
524
+
525
+ # Set Headers
526
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
527
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
528
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
529
+
530
+ request_url = @base_url || @client.base_url
531
+
532
+ options = {
533
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
534
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
535
+ query_params: {'api-version' => api_version},
536
+ headers: request_headers.merge(custom_headers || {}),
537
+ base_url: request_url
538
+ }
539
+ promise = @client.make_request_async(:delete, path_template, options)
540
+
541
+ promise = promise.then do |result|
542
+ http_response = result.response
543
+ status_code = http_response.status
544
+ response_content = http_response.body
545
+ unless status_code == 202 || status_code == 204
546
+ error_model = JSON.load(response_content)
547
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
548
+ end
549
+
550
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
551
+
552
+ result
553
+ end
554
+
555
+ promise.execute
556
+ end
557
+
558
+ end
559
+ end