Skip to content

Commit 3c9abf1

Browse files
feat: Automated regeneration of PaymentsResellerSubscription client (googleapis#12496)
Auto-created at 2024-11-07 13:17:16 +0000 using the toys pull request generator.
1 parent 886f335 commit 3c9abf1

10 files changed

+440
-3
lines changed

clients/payments_reseller_subscription/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_payments_reseller_subscription, "~> 0.5"}]
14+
[{:google_api_payments_reseller_subscription, "~> 0.6"}]
1515
end
1616
```
1717

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

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,4 +824,83 @@ defmodule GoogleApi.PaymentsResellerSubscription.V1.Api.Partners do
824824
]
825825
)
826826
end
827+
828+
@doc """
829+
This API replaces user authorized OAuth consnet based APIs (Create, Entitle). Generates a short-lived token for a user session based on the user intent. You can use the session token to redirect the user to Google to finish the signup flow. You can re-generate new session token repeatedly for same request if necessary, regardless of the previous tokens being expired or not.
830+
831+
## Parameters
832+
833+
* `connection` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Connection.t`) - Connection to server
834+
* `parent` (*type:* `String.t`) - Required. The parent, the partner that can resell. Format: partners/{partner}
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.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionRequest.t`) -
848+
* `opts` (*type:* `keyword()`) - Call options
849+
850+
## Returns
851+
852+
* `{:ok, %GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse{}}` on success
853+
* `{:error, info}` on failure
854+
"""
855+
@spec paymentsresellersubscription_partners_user_sessions_generate(
856+
Tesla.Env.client(),
857+
String.t(),
858+
keyword(),
859+
keyword()
860+
) ::
861+
{:ok,
862+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse.t()}
863+
| {:ok, Tesla.Env.t()}
864+
| {:ok, list()}
865+
| {:error, any()}
866+
def paymentsresellersubscription_partners_user_sessions_generate(
867+
connection,
868+
parent,
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/{+parent}/userSessions:generate", %{
891+
"parent" => URI.encode(parent, &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.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse{}
903+
]
904+
)
905+
end
827906
end

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 "20240616"
23+
@discovery_revision "20241105"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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.GoogleCloudPaymentsResellerSubscriptionV1CreateSubscriptionIntent do
19+
@moduledoc """
20+
Intent message for creating a Subscription resource.
21+
22+
## Attributes
23+
24+
* `parent` (*type:* `String.t`, *default:* `nil`) - Required. The parent resource name, which is the identifier of the partner.
25+
* `subscription` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t`, *default:* `nil`) - Required. The Subscription to be created.
26+
* `subscriptionId` (*type:* `String.t`, *default:* `nil`) - Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription was previously created with the same subscription_id, we will directly return that one.
27+
"""
28+
29+
use GoogleApi.Gax.ModelBase
30+
31+
@type t :: %__MODULE__{
32+
:parent => String.t() | nil,
33+
:subscription =>
34+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription.t()
35+
| nil,
36+
:subscriptionId => String.t() | nil
37+
}
38+
39+
field(:parent)
40+
41+
field(:subscription,
42+
as:
43+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1Subscription
44+
)
45+
46+
field(:subscriptionId)
47+
end
48+
49+
defimpl Poison.Decoder,
50+
for:
51+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1CreateSubscriptionIntent do
52+
def decode(value, options) do
53+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1CreateSubscriptionIntent.decode(
54+
value,
55+
options
56+
)
57+
end
58+
end
59+
60+
defimpl Poison.Encoder,
61+
for:
62+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1CreateSubscriptionIntent do
63+
def encode(value, options) do
64+
GoogleApi.Gax.ModelBase.encode(value, options)
65+
end
66+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionIntent do
19+
@moduledoc """
20+
Intent for entitling the previously provisioned subscription to an end user.
21+
22+
## Attributes
23+
24+
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The name of the subscription resource that is entitled to the current end user.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:name => String.t() | nil
31+
}
32+
33+
field(:name)
34+
end
35+
36+
defimpl Poison.Decoder,
37+
for:
38+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionIntent do
39+
def decode(value, options) do
40+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionIntent.decode(
41+
value,
42+
options
43+
)
44+
end
45+
end
46+
47+
defimpl Poison.Encoder,
48+
for:
49+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionIntent do
50+
def encode(value, options) do
51+
GoogleApi.Gax.ModelBase.encode(value, options)
52+
end
53+
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.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionRequest do
19+
@moduledoc """
20+
[Preview only] Request to generate a user session.
21+
22+
## Attributes
23+
24+
* `intentPayload` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1IntentPayload.t`, *default:* `nil`) - The user intent to generate the user session.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:intentPayload =>
31+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1IntentPayload.t()
32+
| nil
33+
}
34+
35+
field(:intentPayload,
36+
as:
37+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1IntentPayload
38+
)
39+
end
40+
41+
defimpl Poison.Decoder,
42+
for:
43+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionRequest do
44+
def decode(value, options) do
45+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionRequest.decode(
46+
value,
47+
options
48+
)
49+
end
50+
end
51+
52+
defimpl Poison.Encoder,
53+
for:
54+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionRequest 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,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.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse do
19+
@moduledoc """
20+
[Preview only] Response that contains the details for generated user session.
21+
22+
## Attributes
23+
24+
* `userSession` (*type:* `GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1UserSession.t`, *default:* `nil`) - The generated user session. The token size of proportional to the size of the intent payload. Therefore, please be mindful of keeping the request intent payload reasonably small.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:userSession =>
31+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1UserSession.t()
32+
| nil
33+
}
34+
35+
field(:userSession,
36+
as:
37+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1UserSession
38+
)
39+
end
40+
41+
defimpl Poison.Decoder,
42+
for:
43+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse do
44+
def decode(value, options) do
45+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse.decode(
46+
value,
47+
options
48+
)
49+
end
50+
end
51+
52+
defimpl Poison.Encoder,
53+
for:
54+
GoogleApi.PaymentsResellerSubscription.V1.Model.GoogleCloudPaymentsResellerSubscriptionV1GenerateUserSessionResponse do
55+
def encode(value, options) do
56+
GoogleApi.Gax.ModelBase.encode(value, options)
57+
end
58+
end

0 commit comments

Comments
 (0)