Import refactored library. See MIGRATING.MD for details

This commit is contained in:
Steven Bazyl committed 2015-06-23 15:15:14 -07:00
1 parent 9b7809174d
commit f584a2cec8
373 files changed
+255715 -474

No files matched your search

@@ -0,0 +1,132 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module LicensingV1
# Template for LiscenseAssignment Resource
class LicenseAssignment
include Google::Apis::Core::Hashable
# ETag of the resource.
# Corresponds to the JSON property `etags`
# @return [String]
attr_accessor :etags
# Identifies the resource as a LicenseAssignment.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Name of the product.
# Corresponds to the JSON property `productId`
# @return [String]
attr_accessor :product_id
# Link to this page.
# Corresponds to the JSON property `selfLink`
# @return [String]
attr_accessor :self_link
# Name of the sku of the product.
# Corresponds to the JSON property `skuId`
# @return [String]
attr_accessor :sku_id
# Email id of the user.
# Corresponds to the JSON property `userId`
# @return [String]
attr_accessor :user_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@etags = args[:etags] unless args[:etags].nil?
@kind = args[:kind] unless args[:kind].nil?
@product_id = args[:product_id] unless args[:product_id].nil?
@self_link = args[:self_link] unless args[:self_link].nil?
@sku_id = args[:sku_id] unless args[:sku_id].nil?
@user_id = args[:user_id] unless args[:user_id].nil?
end
end
# Template for LicenseAssignment Insert request
class LicenseAssignmentInsert
include Google::Apis::Core::Hashable
# Email id of the user
# Corresponds to the JSON property `userId`
# @return [String]
attr_accessor :user_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@user_id = args[:user_id] unless args[:user_id].nil?
end
end
# LicesnseAssignment List for a given product/sku for a customer.
class LicenseAssignmentList
include Google::Apis::Core::Hashable
# ETag of the resource.
# Corresponds to the JSON property `etag`
# @return [String]
attr_accessor :etag
# The LicenseAssignments in this page of results.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::LicensingV1::LicenseAssignment>]
attr_accessor :items
# Identifies the resource as a collection of LicenseAssignments.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The continuation token, used to page through large result sets. Provide this
# value in a subsequent request to return the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@etag = args[:etag] unless args[:etag].nil?
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
end
end
end
end
end
@@ -0,0 +1,68 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module LicensingV1
class LicenseAssignment
class Representation < Google::Apis::Core::JsonRepresentation; end
end
class LicenseAssignmentInsert
class Representation < Google::Apis::Core::JsonRepresentation; end
end
class LicenseAssignmentList
class Representation < Google::Apis::Core::JsonRepresentation; end
end
# @private
class LicenseAssignment
class Representation < Google::Apis::Core::JsonRepresentation
property :etags, as: 'etags'
property :kind, as: 'kind'
property :product_id, as: 'productId'
property :self_link, as: 'selfLink'
property :sku_id, as: 'skuId'
property :user_id, as: 'userId'
end
end
# @private
class LicenseAssignmentInsert
class Representation < Google::Apis::Core::JsonRepresentation
property :user_id, as: 'userId'
end
end
# @private
class LicenseAssignmentList
class Representation < Google::Apis::Core::JsonRepresentation
property :etag, as: 'etag'
collection :items, as: 'items', class: Google::Apis::LicensingV1::LicenseAssignment, decorator: Google::Apis::LicensingV1::LicenseAssignment::Representation
property :kind, as: 'kind'
property :next_page_token, as: 'nextPageToken'
end
end
end
end
end
@@ -0,0 +1,376 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module LicensingV1
# Enterprise License Manager API
#
# Licensing API to view and manage license for your domain.
#
# @example
# require 'google/apis/licensing_v1'
#
# Licensing = Google::Apis::LicensingV1 # Alias the module
# service = Licensing::LicensingService.new
#
# @see https://developers.google.com/google-apps/licensing/
class LicensingService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
attr_accessor :quota_user
# @return [String]
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
attr_accessor :user_ip
def initialize
super('https://www.googleapis.com/', 'apps/licensing/v1/product/')
end
# Revoke License.
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku
# @param [String] user_id
# email id or unique Id of the user
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_license_assignment(product_id, sku_id, user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/user/{userId}'
command = make_simple_command(:delete, path, options)
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.params['userId'] = user_id unless user_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Get license assignment of a particular product and sku for a user
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku
# @param [String] user_id
# email id or unique Id of the user
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_license_assignment(product_id, sku_id, user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/user/{userId}'
command = make_simple_command(:get, path, options)
command.response_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignment
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.params['userId'] = user_id unless user_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Assign License.
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku
# @param [Google::Apis::LicensingV1::LicenseAssignmentInsert] license_assignment_insert_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_license_assignment(product_id, sku_id, license_assignment_insert_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/user'
command = make_simple_command(:post, path, options)
command.request_representation = Google::Apis::LicensingV1::LicenseAssignmentInsert::Representation
command.request_object = license_assignment_insert_object
command.response_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignment
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# List license assignments for given product of the customer.
# @param [String] product_id
# Name for product
# @param [String] customer_id
# CustomerId represents the customer for whom licenseassignments are queried
# @param [Fixnum] max_results
# Maximum number of campaigns to return at one time. Must be positive. Optional.
# Default value is 100.
# @param [String] page_token
# Token to fetch the next page.Optional. By default server will return first
# page
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignmentList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignmentList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_license_assignment_for_product(product_id, customer_id: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/users'
command = make_simple_command(:get, path, options)
command.response_representation = Google::Apis::LicensingV1::LicenseAssignmentList::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignmentList
command.params['productId'] = product_id unless product_id.nil?
command.query['customerId'] = customer_id unless customer_id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# List license assignments for given product and sku of the customer.
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku
# @param [String] customer_id
# CustomerId represents the customer for whom licenseassignments are queried
# @param [Fixnum] max_results
# Maximum number of campaigns to return at one time. Must be positive. Optional.
# Default value is 100.
# @param [String] page_token
# Token to fetch the next page.Optional. By default server will return first
# page
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignmentList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignmentList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_license_assignment_for_product_and_sku(product_id, sku_id, customer_id: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/users'
command = make_simple_command(:get, path, options)
command.response_representation = Google::Apis::LicensingV1::LicenseAssignmentList::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignmentList
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.query['customerId'] = customer_id unless customer_id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Assign License. This method supports patch semantics.
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku for which license would be revoked
# @param [String] user_id
# email id or unique Id of the user
# @param [Google::Apis::LicensingV1::LicenseAssignment] license_assignment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def patch_license_assignment(product_id, sku_id, user_id, license_assignment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/user/{userId}'
command = make_simple_command(:patch, path, options)
command.request_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.request_object = license_assignment_object
command.response_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignment
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.params['userId'] = user_id unless user_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Assign License.
# @param [String] product_id
# Name for product
# @param [String] sku_id
# Name for sku for which license would be revoked
# @param [String] user_id
# email id or unique Id of the user
# @param [Google::Apis::LicensingV1::LicenseAssignment] license_assignment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# Overrides userIp if both are provided.
# @param [String] user_ip
# IP address of the site where the request originates. Use this if you want to
# enforce per-user limits.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::LicensingV1::LicenseAssignment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::LicensingV1::LicenseAssignment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_license_assignment(product_id, sku_id, user_id, license_assignment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
path = '{productId}/sku/{skuId}/user/{userId}'
command = make_simple_command(:put, path, options)
command.request_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.request_object = license_assignment_object
command.response_representation = Google::Apis::LicensingV1::LicenseAssignment::Representation
command.response_class = Google::Apis::LicensingV1::LicenseAssignment
command.params['productId'] = product_id unless product_id.nil?
command.params['skuId'] = sku_id unless sku_id.nil?
command.params['userId'] = user_id unless user_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
end
end
end
end
end