Skip to content

Commit 4d3f17c

Browse files
feat: Automated regeneration of PaymentsResellerSubscription client (#13259)
Auto-created at 2025-03-29 13:13:36 +0000 using the toys pull request generator.
1 parent ec88a94 commit 4d3f17c

6 files changed

+371
-1
lines changed

clients/payments_reseller_subscription/lib/google_api/payments_reseller_subscription/v1/api/partners.ex

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,164 @@ defmodule GoogleApi.PaymentsResellerSubscription.V1.Api.Partners do
746746
)
747747
end
748748

749+
@doc """
750+
Resumes a suspended subscription. The new billing cycle will start at the time of the request. It should be called directly by the partner using service accounts.
751+
752+
## Parameters
753+
754+
* `connection` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Connection.t`) - Connection to server
755+
* `name` (*type:* `String.t`) - Required. The name of the subscription resource to be resumed. It will have the format of "partners/{partner_id}/subscriptions/{subscription_id}"
756+
* `optional_params` (*type:* `keyword()`) - Optional parameters
757+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
758+
* `:access_token` (*type:* `String.t`) - OAuth access token.
759+
* `:alt` (*type:* `String.t`) - Data format for response.
760+
* `:callback` (*type:* `String.t`) - JSONP
761+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
762+
* `:key` (*type:* `String.t`) - 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.
763+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
764+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
765+
* `:quotaUser` (*type:* `String.t`) - 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.
766+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
767+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
768+
* `:body` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionRequest.t`) -
769+
* `opts` (*type:* `keyword()`) - Call options
770+
771+
## Returns
772+
773+
* `{:ok, %GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse{}}` on success
774+
* `{:error, info}` on failure
775+
"""
776+
@spec paymentsresellersubscription_partners_subscriptions_resume(
777+
Tesla.Env.client(),
778+
String.t(),
779+
keyword(),
780+
keyword()
781+
) ::
782+
{:ok,
783+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse.t()}
784+
| {:ok, Tesla.Env.t()}
785+
| {:ok, list()}
786+
| {:error, any()}
787+
def paymentsresellersubscription_partners_subscriptions_resume(
788+
connection,
789+
name,
790+
optional_params \\ [],
791+
opts \\ []
792+
) do
793+
optional_params_config = %{
794+
:"$.xgafv" => :query,
795+
:access_token => :query,
796+
:alt => :query,
797+
:callback => :query,
798+
:fields => :query,
799+
:key => :query,
800+
:oauth_token => :query,
801+
:prettyPrint => :query,
802+
:quotaUser => :query,
803+
:uploadType => :query,
804+
:upload_protocol => :query,
805+
:body => :body
806+
}
807+
808+
request =
809+
Request.new()
810+
|> Request.method(:post)
811+
|> Request.url("/v1/{+name}:resume", %{
812+
"name" => URI.encode(name, &URI.char_unreserved?/1)
813+
})
814+
|> Request.add_optional_params(optional_params_config, optional_params)
815+
|> Request.library_version(@library_version)
816+
817+
connection
818+
|> Connection.execute(request)
819+
|> Response.decode(
820+
opts ++
821+
[
822+
struct:
823+
%GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse{}
824+
]
825+
)
826+
end
827+
828+
@doc """
829+
Suspends a subscription. Contract terms may dictate if a prorated refund will be issued upon suspension. It should be called directly by the partner using service accounts.
830+
831+
## Parameters
832+
833+
* `connection` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Connection.t`) - Connection to server
834+
* `name` (*type:* `String.t`) - Required. The name of the subscription resource to be suspended. It will have the format of "partners/{partner_id}/subscriptions/{subscription_id}"
835+
* `optional_params` (*type:* `keyword()`) - Optional parameters
836+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
837+
* `:access_token` (*type:* `String.t`) - OAuth access token.
838+
* `:alt` (*type:* `String.t`) - Data format for response.
839+
* `:callback` (*type:* `String.t`) - JSONP
840+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
841+
* `:key` (*type:* `String.t`) - 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.
842+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
843+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
844+
* `:quotaUser` (*type:* `String.t`) - 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.
845+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
846+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
847+
* `:body` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionRequest.t`) -
848+
* `opts` (*type:* `keyword()`) - Call options
849+
850+
## Returns
851+
852+
* `{:ok, %GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse{}}` on success
853+
* `{:error, info}` on failure
854+
"""
855+
@spec paymentsresellersubscription_partners_subscriptions_suspend(
856+
Tesla.Env.client(),
857+
String.t(),
858+
keyword(),
859+
keyword()
860+
) ::
861+
{:ok,
862+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse.t()}
863+
| {:ok, Tesla.Env.t()}
864+
| {:ok, list()}
865+
| {:error, any()}
866+
def paymentsresellersubscription_partners_subscriptions_suspend(
867+
connection,
868+
name,
869+
optional_params \\ [],
870+
opts \\ []
871+
) do
872+
optional_params_config = %{
873+
:"$.xgafv" => :query,
874+
:access_token => :query,
875+
:alt => :query,
876+
:callback => :query,
877+
:fields => :query,
878+
:key => :query,
879+
:oauth_token => :query,
880+
:prettyPrint => :query,
881+
:quotaUser => :query,
882+
:uploadType => :query,
883+
:upload_protocol => :query,
884+
:body => :body
885+
}
886+
887+
request =
888+
Request.new()
889+
|> Request.method(:post)
890+
|> Request.url("/v1/{+name}:suspend", %{
891+
"name" => URI.encode(name, &URI.char_unreserved?/1)
892+
})
893+
|> Request.add_optional_params(optional_params_config, optional_params)
894+
|> Request.library_version(@library_version)
895+
896+
connection
897+
|> Connection.execute(request)
898+
|> Response.decode(
899+
opts ++
900+
[
901+
struct:
902+
%GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse{}
903+
]
904+
)
905+
end
906+
749907
@doc """
750908
Currently, it is used by **Google One, Play Pass** partners. Revokes the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.
751909

clients/payments_reseller_subscription/lib/google_api/payments_reseller_subscription/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.PaymentsResellerSubscription.V1 do
2020
API client metadata for GoogleApi.PaymentsResellerSubscription.V1.
2121
"""
2222

23-
@discovery_revision "20250312"
23+
@discovery_revision "20250327"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2019 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+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionRequest do
19+
@moduledoc """
20+
Request to resume a suspended subscription.
21+
22+
## Attributes
23+
24+
"""
25+
26+
use GoogleApi.Gax.ModelBase
27+
28+
@type t :: %__MODULE__{}
29+
end
30+
31+
defimpl Poison.Decoder,
32+
for:
33+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionRequest do
34+
def decode(value, options) do
35+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionRequest.decode(
36+
value,
37+
options
38+
)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder,
43+
for:
44+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionRequest do
45+
def encode(value, options) do
46+
GoogleApi.Gax.ModelBase.encode(value, options)
47+
end
48+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright 2019 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+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse do
19+
@moduledoc """
20+
Response that contains the resumed subscription.
21+
22+
## Attributes
23+
24+
* `subscription` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t`, *default:* `nil`) - The resumed subscription resource.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:subscription =>
31+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t()
32+
| nil
33+
}
34+
35+
field(:subscription,
36+
as:
37+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription
38+
)
39+
end
40+
41+
defimpl Poison.Decoder,
42+
for:
43+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse do
44+
def decode(value, options) do
45+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse.decode(
46+
value,
47+
options
48+
)
49+
end
50+
end
51+
52+
defimpl Poison.Encoder,
53+
for:
54+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1ResumeSubscriptionResponse do
55+
def encode(value, options) do
56+
GoogleApi.Gax.ModelBase.encode(value, options)
57+
end
58+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2019 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+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionRequest do
19+
@moduledoc """
20+
Request to suspend a subscription.
21+
22+
## Attributes
23+
24+
"""
25+
26+
use GoogleApi.Gax.ModelBase
27+
28+
@type t :: %__MODULE__{}
29+
end
30+
31+
defimpl Poison.Decoder,
32+
for:
33+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionRequest do
34+
def decode(value, options) do
35+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionRequest.decode(
36+
value,
37+
options
38+
)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder,
43+
for:
44+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionRequest do
45+
def encode(value, options) do
46+
GoogleApi.Gax.ModelBase.encode(value, options)
47+
end
48+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright 2019 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+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse do
19+
@moduledoc """
20+
Response that contains the suspended subscription.
21+
22+
## Attributes
23+
24+
* `subscription` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t`, *default:* `nil`) - The suspended subscription resource.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:subscription =>
31+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t()
32+
| nil
33+
}
34+
35+
field(:subscription,
36+
as:
37+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription
38+
)
39+
end
40+
41+
defimpl Poison.Decoder,
42+
for:
43+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse do
44+
def decode(value, options) do
45+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse.decode(
46+
value,
47+
options
48+
)
49+
end
50+
end
51+
52+
defimpl Poison.Encoder,
53+
for:
54+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1SuspendSubscriptionResponse do
55+
def encode(value, options) do
56+
GoogleApi.Gax.ModelBase.encode(value, options)
57+
end
58+
end

0 commit comments

Comments
 (0)