Class: Azure::MobileEngagement::Mgmt::V2014_12_01::EngagementManagementClient
- Inherits:
-
MsRestAzure::AzureServiceClient
- Object
- MsRestAzure::AzureServiceClient
- Azure::MobileEngagement::Mgmt::V2014_12_01::EngagementManagementClient
- Includes:
- MsRestAzure, MsRestAzure::Serialization
- Defined in:
- lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb
Overview
A service client - single point of access to the REST API.
Instance Attribute Summary collapse
-
#accept_language ⇒ String
Gets or sets the preferred language for the response.
-
#api_version ⇒ String
readonly
Client Api Version.
-
#app_collections ⇒ AppCollections
readonly
App_collections.
-
#apps ⇒ Apps
readonly
Apps.
-
#base_url ⇒ String
The base URI of the service.
-
#campaigns ⇒ Campaigns
readonly
Campaigns.
-
#credentials ⇒ Object
readonly
Credentials needed for the client to connect to Azure.
-
#devices ⇒ Devices
readonly
Devices.
-
#export_tasks ⇒ ExportTasks
readonly
Export_tasks.
-
#generate_client_request_id ⇒ Boolean
is generated and included in each request.
-
#import_tasks ⇒ ImportTasks
readonly
Import_tasks.
-
#long_running_operation_retry_timeout ⇒ Integer
Running Operations.
-
#subscription_id ⇒ String
Microsoft Azure subscription.
-
#supported_platforms ⇒ SupportedPlatforms
readonly
Supported_platforms.
Instance Method Summary collapse
-
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ EngagementManagementClient
constructor
Creates initializes a new instance of the EngagementManagementClient class.
-
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response.
-
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
-
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
Constructor Details
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ EngagementManagementClient
Creates initializes a new instance of the EngagementManagementClient class.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 66 def initialize(credentials = nil, base_url = nil, = nil) super(credentials, ) @base_url = base_url || 'https://management.azure.com' fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials @app_collections = AppCollections.new(self) @apps = Apps.new(self) @supported_platforms = SupportedPlatforms.new(self) @campaigns = Campaigns.new(self) @devices = Devices.new(self) @export_tasks = ExportTasks.new(self) @import_tasks = ImportTasks.new(self) @api_version = '2014-12-01' @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true add_telemetry end |
Instance Attribute Details
#accept_language ⇒ String
Returns Gets or sets the preferred language for the response.
29 30 31 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 29 def accept_language @accept_language end |
#api_version ⇒ String (readonly)
Returns Client Api Version.
26 27 28 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 26 def api_version @api_version end |
#app_collections ⇒ AppCollections (readonly)
Returns app_collections.
40 41 42 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 40 def app_collections @app_collections end |
#apps ⇒ Apps (readonly)
Returns apps.
43 44 45 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 43 def apps @apps end |
#base_url ⇒ String
Returns the base URI of the service.
15 16 17 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 15 def base_url @base_url end |
#campaigns ⇒ Campaigns (readonly)
Returns campaigns.
49 50 51 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 49 def campaigns @campaigns end |
#credentials ⇒ Object (readonly)
Returns Credentials needed for the client to connect to Azure.
18 19 20 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 18 def credentials @credentials end |
#devices ⇒ Devices (readonly)
Returns devices.
52 53 54 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 52 def devices @devices end |
#export_tasks ⇒ ExportTasks (readonly)
Returns export_tasks.
55 56 57 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 55 def export_tasks @export_tasks end |
#generate_client_request_id ⇒ Boolean
is generated and included in each request. Default is true.
37 38 39 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 37 def generate_client_request_id @generate_client_request_id end |
#import_tasks ⇒ ImportTasks (readonly)
Returns import_tasks.
58 59 60 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 58 def import_tasks @import_tasks end |
#long_running_operation_retry_timeout ⇒ Integer
Running Operations. Default value is 30.
33 34 35 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 33 def long_running_operation_retry_timeout @long_running_operation_retry_timeout end |
#subscription_id ⇒ String
Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
23 24 25 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 23 def subscription_id @subscription_id end |
#supported_platforms ⇒ SupportedPlatforms (readonly)
Returns supported_platforms.
46 47 48 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 46 def supported_platforms @supported_platforms end |
Instance Method Details
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response. Example:
request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
= {
body: request_content,
query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, )
103 104 105 106 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 103 def make_request(method, path, = {}) result = make_request_with_http_info(method, path, ) result.body unless result.nil? end |
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 128 def make_request_async(method, path, = {}) fail ArgumentError, 'method is nil' if method.nil? fail ArgumentError, 'path is nil' if path.nil? request_url = [:base_url] || @base_url request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? .merge!({headers: request_headers.merge([:headers] || {})}) .merge!({credentials: @credentials}) unless @credentials.nil? super(request_url, method, path, ) end |
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
115 116 117 118 119 |
# File 'lib/2014-12-01/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb', line 115 def make_request_with_http_info(method, path, = {}) result = make_request_async(method, path, ).value! result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) result end |