google-apis-cloudbilling_v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,129 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudbillingV1beta
23
+ # Cloud Billing API
24
+ #
25
+ # Allows developers to manage billing for their Google Cloud Platform projects
26
+ # programmatically.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudbilling_v1beta'
30
+ #
31
+ # Cloudbilling = Google::Apis::CloudbillingV1beta # Alias the module
32
+ # service = Cloudbilling::CloudbillingService.new
33
+ #
34
+ # @see https://cloud.google.com/billing/
35
+ class CloudbillingService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudbilling.googleapis.com/', '',
48
+ client_name: 'google-apis-cloudbilling_v1beta',
49
+ client_version: Google::Apis::CloudbillingV1beta::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Use custom pricing in the estimate, using a `CostScenario` with a defined `
54
+ # billingAccount`.
55
+ # @param [String] billing_account
56
+ # Resource name of the billing account for the cost estimate. The resource name
57
+ # has the form `billingAccounts/`billing_acount_id``. For example, `
58
+ # billingAccounts/012345-567890-ABCDEF` is the resource name for billing account
59
+ # `012345-567890-ABCDEF`. Must be specified.
60
+ # @param [Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountRequest] estimate_cost_scenario_for_billing_account_request_object
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def estimate_cost_scenario_for_billing_account(billing_account, estimate_cost_scenario_for_billing_account_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v1beta/{+billingAccount}:estimateCostScenario', options)
80
+ command.request_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountRequest::Representation
81
+ command.request_object = estimate_cost_scenario_for_billing_account_request_object
82
+ command.response_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse::Representation
83
+ command.response_class = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse
84
+ command.params['billingAccount'] = billing_account unless billing_account.nil?
85
+ command.query['fields'] = fields unless fields.nil?
86
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
87
+ execute_or_queue_command(command, &block)
88
+ end
89
+
90
+ # Estimate list prices using a `CostScenario` without a defined `billingAccount`.
91
+ # @param [Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceRequest] estimate_cost_scenario_with_list_price_request_object
92
+ # @param [String] fields
93
+ # Selector specifying which fields to include in a partial response.
94
+ # @param [String] quota_user
95
+ # Available to use for quota purposes for server-side applications. Can be any
96
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def estimate_cost_scenario_with_list_price(estimate_cost_scenario_with_list_price_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
110
+ command = make_simple_command(:post, 'v1beta:estimateCostScenario', options)
111
+ command.request_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceRequest::Representation
112
+ command.request_object = estimate_cost_scenario_with_list_price_request_object
113
+ command.response_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse::Representation
114
+ command.response_class = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ protected
121
+
122
+ def apply_command_defaults(command)
123
+ command.query['key'] = key unless key.nil?
124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,43 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/cloudbilling_v1beta/service.rb'
16
+ require 'google/apis/cloudbilling_v1beta/classes.rb'
17
+ require 'google/apis/cloudbilling_v1beta/representations.rb'
18
+ require 'google/apis/cloudbilling_v1beta/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Cloud Billing API
23
+ #
24
+ # Allows developers to manage billing for their Google Cloud Platform projects
25
+ # programmatically.
26
+ #
27
+ # @see https://cloud.google.com/billing/
28
+ module CloudbillingV1beta
29
+ # Version of the Cloud Billing API this client connects to.
30
+ # This is NOT the gem version.
31
+ VERSION = 'V1beta'
32
+
33
+ # View and manage your Google Cloud Platform billing accounts
34
+ AUTH_CLOUD_BILLING = 'https://www.googleapis.com/auth/cloud-billing'
35
+
36
+ # View your Google Cloud Platform billing accounts
37
+ AUTH_CLOUD_BILLING_READONLY = 'https://www.googleapis.com/auth/cloud-billing.readonly'
38
+
39
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
40
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/cloudbilling_v1beta"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-cloudbilling_v1beta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.a
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.a
33
+ description: This is the simple REST client for Cloud Billing API V1beta. Simple REST
34
+ clients are Ruby client libraries that provide access to Google services via their
35
+ HTTP REST API endpoints. These libraries are generated and updated automatically
36
+ based on the discovery documents published by the service, and they handle most
37
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
38
+ use this client to access the Cloud Billing API, but note that some services may
39
+ provide a separate modern client that is easier to use.
40
+ email: googleapis-packages@google.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".yardopts"
46
+ - CHANGELOG.md
47
+ - LICENSE.md
48
+ - OVERVIEW.md
49
+ - lib/google-apis-cloudbilling_v1beta.rb
50
+ - lib/google/apis/cloudbilling_v1beta.rb
51
+ - lib/google/apis/cloudbilling_v1beta/classes.rb
52
+ - lib/google/apis/cloudbilling_v1beta/gem_version.rb
53
+ - lib/google/apis/cloudbilling_v1beta/representations.rb
54
+ - lib/google/apis/cloudbilling_v1beta/service.rb
55
+ homepage: https://github.com/google/google-api-ruby-client
56
+ licenses:
57
+ - Apache-2.0
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-cloudbilling_v1beta/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudbilling_v1beta/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-cloudbilling_v1beta
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '2.5'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.3.14
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Simple REST client for Cloud Billing API V1beta
82
+ test_files: []