/usr/lib/ruby/vendor_ruby/generated/azure_mgmt_mobile_engagement/engagement_management_client.rb is in ruby-azure-mgmt-mobile-engagement 0.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::MobileEngagement
#
# A service client - single point of access to the REST API.
#
class EngagementManagementClient < MsRestAzure::AzureServiceClient
include MsRestAzure
include MsRestAzure::Serialization
# @return [String] the base URI of the service.
attr_accessor :base_url
# @return Credentials needed for the client to connect to Azure.
attr_reader :credentials
# @return [String] Gets subscription credentials which uniquely identify
# Microsoft Azure subscription. The subscription ID forms part of the URI
# for every service call.
attr_accessor :subscription_id
# @return [String] Client Api Version.
attr_reader :api_version
# @return [String] The name of the resource group.
attr_accessor :resource_group_name
# @return [String] Application collection.
attr_accessor :app_collection
# @return [String] Application resource name.
attr_accessor :app_name
# @return [String] Gets or sets the preferred language for the response.
attr_accessor :accept_language
# @return [Integer] Gets or sets the retry timeout in seconds for Long
# Running Operations. Default value is 30.
attr_accessor :long_running_operation_retry_timeout
# @return [Boolean] When set to true a unique x-ms-client-request-id value
# is generated and included in each request. Default is true.
attr_accessor :generate_client_request_id
# @return [AppCollections] app_collections
attr_reader :app_collections
# @return [Apps] apps
attr_reader :apps
# @return [SupportedPlatforms] supported_platforms
attr_reader :supported_platforms
# @return [Campaigns] campaigns
attr_reader :campaigns
# @return [Devices] devices
attr_reader :devices
# @return [ExportTasks] export_tasks
attr_reader :export_tasks
# @return [ImportTasks] import_tasks
attr_reader :import_tasks
#
# Creates initializes a new instance of the EngagementManagementClient class.
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
# @param base_url [String] the base URI of the service.
# @param options [Array] filters to be applied to the HTTP requests.
#
def initialize(credentials, base_url = nil, options = nil)
super(credentials, options)
@base_url = base_url || 'https://management.azure.com'
fail ArgumentError, 'credentials is nil' if credentials.nil?
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials)
@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
#
# Makes a request and returns the body of the response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Hash{String=>String}] containing the body of the response.
# Example:
#
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
# path = "/path"
# options = {
# body: request_content,
# query_params: {'api-version' => '2016-02-01'}
# }
# result = @client.make_request(:put, path, options)
#
def make_request(method, path, options = {})
result = make_request_with_http_info(method, path, options)
result.body unless result.nil?
end
#
# Makes a request and returns the operation response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
#
def make_request_with_http_info(method, path, options = {})
result = make_request_async(method, path, options).value!
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
result
end
#
# Makes a request asynchronously.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def make_request_async(method, path, options = {})
fail ArgumentError, 'method is nil' if method.nil?
fail ArgumentError, 'path is nil' if path.nil?
request_url = options[:base_url] || @base_url
request_headers = @request_headers
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
options.merge!({headers: request_headers.merge(options[:headers] || {})})
options.merge!({credentials: @credentials}) unless @credentials.nil?
super(request_url, method, path, options)
end
private
#
# Adds telemetry information.
#
def add_telemetry
sdk_information = 'azure_mgmt_mobile_engagement'
if defined? Azure::ARM::MobileEngagement::VERSION
sdk_information = "#{sdk_information}/#{Azure::ARM::MobileEngagement::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
end
|