Skip to content

Commit 89157d6

Browse files
feat: [google-cloud-billing] added currency field to billing account message (googleapis#13319)
BEGIN_COMMIT_OVERRIDE feat: added currency field to billing account message END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 702355285 Source-Link: googleapis/googleapis@e5a3912 Source-Link: https://github.com/googleapis/googleapis-gen/commit/82539f2cc9651f205e4a1343cf1cc87a28922ce8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmcvLk93bEJvdC55YW1sIiwiaCI6IjgyNTM5ZjJjYzk2NTFmMjA1ZTRhMTM0M2NmMWNjODdhMjg5MjJjZTgifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent 9e33676 commit 89157d6

File tree

5 files changed

+49
-3
lines changed

5 files changed

+49
-3
lines changed

packages/google-cloud-billing/google/cloud/billing/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.14.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-billing/google/cloud/billing_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.14.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-billing/google/cloud/billing_v1/types/cloud_billing.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ class BillingAccount(proto.Message):
7878
``organizations/12345678``
7979
- ``billingAccounts/{billing_account_id}``, for example,
8080
``billingAccounts/012345-567890-ABCDEF``
81+
currency_code (str):
82+
Optional. The currency in which the billing account is
83+
billed and charged, represented as an ISO 4217 code such as
84+
``USD``.
85+
86+
Billing account currency is determined at the time of
87+
billing account creation and cannot be updated subsequently,
88+
so this field should not be set on update requests. In
89+
addition, a subaccount always matches the currency of its
90+
parent billing account, so this field should not be set on
91+
subaccount creation requests. Clients can read this field to
92+
determine the currency of an existing billing account.
8193
"""
8294

8395
name: str = proto.Field(
@@ -100,6 +112,10 @@ class BillingAccount(proto.Message):
100112
proto.STRING,
101113
number=6,
102114
)
115+
currency_code: str = proto.Field(
116+
proto.STRING,
117+
number=7,
118+
)
103119

104120

105121
class ProjectBillingInfo(proto.Message):

packages/google-cloud-billing/samples/generated_samples/snippet_metadata_google.cloud.billing.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-billing",
11-
"version": "1.14.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-billing/tests/unit/gapic/billing_v1/test_cloud_billing.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ def test_get_billing_account(request_type, transport: str = "grpc"):
10741074
display_name="display_name_value",
10751075
master_billing_account="master_billing_account_value",
10761076
parent="parent_value",
1077+
currency_code="currency_code_value",
10771078
)
10781079
response = client.get_billing_account(request)
10791080

@@ -1090,6 +1091,7 @@ def test_get_billing_account(request_type, transport: str = "grpc"):
10901091
assert response.display_name == "display_name_value"
10911092
assert response.master_billing_account == "master_billing_account_value"
10921093
assert response.parent == "parent_value"
1094+
assert response.currency_code == "currency_code_value"
10931095

10941096

10951097
def test_get_billing_account_non_empty_request_with_auto_populated_field():
@@ -1228,6 +1230,7 @@ async def test_get_billing_account_async(
12281230
display_name="display_name_value",
12291231
master_billing_account="master_billing_account_value",
12301232
parent="parent_value",
1233+
currency_code="currency_code_value",
12311234
)
12321235
)
12331236
response = await client.get_billing_account(request)
@@ -1245,6 +1248,7 @@ async def test_get_billing_account_async(
12451248
assert response.display_name == "display_name_value"
12461249
assert response.master_billing_account == "master_billing_account_value"
12471250
assert response.parent == "parent_value"
1251+
assert response.currency_code == "currency_code_value"
12481252

12491253

12501254
@pytest.mark.asyncio
@@ -1912,6 +1916,7 @@ def test_update_billing_account(request_type, transport: str = "grpc"):
19121916
display_name="display_name_value",
19131917
master_billing_account="master_billing_account_value",
19141918
parent="parent_value",
1919+
currency_code="currency_code_value",
19151920
)
19161921
response = client.update_billing_account(request)
19171922

@@ -1928,6 +1933,7 @@ def test_update_billing_account(request_type, transport: str = "grpc"):
19281933
assert response.display_name == "display_name_value"
19291934
assert response.master_billing_account == "master_billing_account_value"
19301935
assert response.parent == "parent_value"
1936+
assert response.currency_code == "currency_code_value"
19311937

19321938

19331939
def test_update_billing_account_non_empty_request_with_auto_populated_field():
@@ -2068,6 +2074,7 @@ async def test_update_billing_account_async(
20682074
display_name="display_name_value",
20692075
master_billing_account="master_billing_account_value",
20702076
parent="parent_value",
2077+
currency_code="currency_code_value",
20712078
)
20722079
)
20732080
response = await client.update_billing_account(request)
@@ -2085,6 +2092,7 @@ async def test_update_billing_account_async(
20852092
assert response.display_name == "display_name_value"
20862093
assert response.master_billing_account == "master_billing_account_value"
20872094
assert response.parent == "parent_value"
2095+
assert response.currency_code == "currency_code_value"
20882096

20892097

20902098
@pytest.mark.asyncio
@@ -2281,6 +2289,7 @@ def test_create_billing_account(request_type, transport: str = "grpc"):
22812289
display_name="display_name_value",
22822290
master_billing_account="master_billing_account_value",
22832291
parent="parent_value",
2292+
currency_code="currency_code_value",
22842293
)
22852294
response = client.create_billing_account(request)
22862295

@@ -2297,6 +2306,7 @@ def test_create_billing_account(request_type, transport: str = "grpc"):
22972306
assert response.display_name == "display_name_value"
22982307
assert response.master_billing_account == "master_billing_account_value"
22992308
assert response.parent == "parent_value"
2309+
assert response.currency_code == "currency_code_value"
23002310

23012311

23022312
def test_create_billing_account_non_empty_request_with_auto_populated_field():
@@ -2437,6 +2447,7 @@ async def test_create_billing_account_async(
24372447
display_name="display_name_value",
24382448
master_billing_account="master_billing_account_value",
24392449
parent="parent_value",
2450+
currency_code="currency_code_value",
24402451
)
24412452
)
24422453
response = await client.create_billing_account(request)
@@ -2454,6 +2465,7 @@ async def test_create_billing_account_async(
24542465
assert response.display_name == "display_name_value"
24552466
assert response.master_billing_account == "master_billing_account_value"
24562467
assert response.parent == "parent_value"
2468+
assert response.currency_code == "currency_code_value"
24572469

24582470

24592471
@pytest.mark.asyncio
@@ -4906,6 +4918,7 @@ def test_move_billing_account(request_type, transport: str = "grpc"):
49064918
display_name="display_name_value",
49074919
master_billing_account="master_billing_account_value",
49084920
parent="parent_value",
4921+
currency_code="currency_code_value",
49094922
)
49104923
response = client.move_billing_account(request)
49114924

@@ -4922,6 +4935,7 @@ def test_move_billing_account(request_type, transport: str = "grpc"):
49224935
assert response.display_name == "display_name_value"
49234936
assert response.master_billing_account == "master_billing_account_value"
49244937
assert response.parent == "parent_value"
4938+
assert response.currency_code == "currency_code_value"
49254939

49264940

49274941
def test_move_billing_account_non_empty_request_with_auto_populated_field():
@@ -5063,6 +5077,7 @@ async def test_move_billing_account_async(
50635077
display_name="display_name_value",
50645078
master_billing_account="master_billing_account_value",
50655079
parent="parent_value",
5080+
currency_code="currency_code_value",
50665081
)
50675082
)
50685083
response = await client.move_billing_account(request)
@@ -5080,6 +5095,7 @@ async def test_move_billing_account_async(
50805095
assert response.display_name == "display_name_value"
50815096
assert response.master_billing_account == "master_billing_account_value"
50825097
assert response.parent == "parent_value"
5098+
assert response.currency_code == "currency_code_value"
50835099

50845100

50855101
@pytest.mark.asyncio
@@ -7548,6 +7564,7 @@ async def test_get_billing_account_empty_call_grpc_asyncio():
75487564
display_name="display_name_value",
75497565
master_billing_account="master_billing_account_value",
75507566
parent="parent_value",
7567+
currency_code="currency_code_value",
75517568
)
75527569
)
75537570
await client.get_billing_account(request=None)
@@ -7610,6 +7627,7 @@ async def test_update_billing_account_empty_call_grpc_asyncio():
76107627
display_name="display_name_value",
76117628
master_billing_account="master_billing_account_value",
76127629
parent="parent_value",
7630+
currency_code="currency_code_value",
76137631
)
76147632
)
76157633
await client.update_billing_account(request=None)
@@ -7643,6 +7661,7 @@ async def test_create_billing_account_empty_call_grpc_asyncio():
76437661
display_name="display_name_value",
76447662
master_billing_account="master_billing_account_value",
76457663
parent="parent_value",
7664+
currency_code="currency_code_value",
76467665
)
76477666
)
76487667
await client.create_billing_account(request=None)
@@ -7854,6 +7873,7 @@ async def test_move_billing_account_empty_call_grpc_asyncio():
78547873
display_name="display_name_value",
78557874
master_billing_account="master_billing_account_value",
78567875
parent="parent_value",
7876+
currency_code="currency_code_value",
78577877
)
78587878
)
78597879
await client.move_billing_account(request=None)
@@ -7922,6 +7942,7 @@ def test_get_billing_account_rest_call_success(request_type):
79227942
display_name="display_name_value",
79237943
master_billing_account="master_billing_account_value",
79247944
parent="parent_value",
7945+
currency_code="currency_code_value",
79257946
)
79267947

79277948
# Wrap the value into a proper Response obj
@@ -7942,6 +7963,7 @@ def test_get_billing_account_rest_call_success(request_type):
79427963
assert response.display_name == "display_name_value"
79437964
assert response.master_billing_account == "master_billing_account_value"
79447965
assert response.parent == "parent_value"
7966+
assert response.currency_code == "currency_code_value"
79457967

79467968

79477969
@pytest.mark.parametrize("null_interceptor", [True, False])
@@ -8167,6 +8189,7 @@ def test_update_billing_account_rest_call_success(request_type):
81678189
"display_name": "display_name_value",
81688190
"master_billing_account": "master_billing_account_value",
81698191
"parent": "parent_value",
8192+
"currency_code": "currency_code_value",
81708193
}
81718194
# The version of a generated dependency at test runtime may differ from the version used during generation.
81728195
# Delete any fields which are not present in the current runtime dependency
@@ -8246,6 +8269,7 @@ def get_message_fields(field):
82468269
display_name="display_name_value",
82478270
master_billing_account="master_billing_account_value",
82488271
parent="parent_value",
8272+
currency_code="currency_code_value",
82498273
)
82508274

82518275
# Wrap the value into a proper Response obj
@@ -8266,6 +8290,7 @@ def get_message_fields(field):
82668290
assert response.display_name == "display_name_value"
82678291
assert response.master_billing_account == "master_billing_account_value"
82688292
assert response.parent == "parent_value"
8293+
assert response.currency_code == "currency_code_value"
82698294

82708295

82718296
@pytest.mark.parametrize("null_interceptor", [True, False])
@@ -8370,6 +8395,7 @@ def test_create_billing_account_rest_call_success(request_type):
83708395
"display_name": "display_name_value",
83718396
"master_billing_account": "master_billing_account_value",
83728397
"parent": "parent_value",
8398+
"currency_code": "currency_code_value",
83738399
}
83748400
# The version of a generated dependency at test runtime may differ from the version used during generation.
83758401
# Delete any fields which are not present in the current runtime dependency
@@ -8451,6 +8477,7 @@ def get_message_fields(field):
84518477
display_name="display_name_value",
84528478
master_billing_account="master_billing_account_value",
84538479
parent="parent_value",
8480+
currency_code="currency_code_value",
84548481
)
84558482

84568483
# Wrap the value into a proper Response obj
@@ -8471,6 +8498,7 @@ def get_message_fields(field):
84718498
assert response.display_name == "display_name_value"
84728499
assert response.master_billing_account == "master_billing_account_value"
84738500
assert response.parent == "parent_value"
8501+
assert response.currency_code == "currency_code_value"
84748502

84758503

84768504
@pytest.mark.parametrize("null_interceptor", [True, False])
@@ -9380,6 +9408,7 @@ def test_move_billing_account_rest_call_success(request_type):
93809408
display_name="display_name_value",
93819409
master_billing_account="master_billing_account_value",
93829410
parent="parent_value",
9411+
currency_code="currency_code_value",
93839412
)
93849413

93859414
# Wrap the value into a proper Response obj
@@ -9400,6 +9429,7 @@ def test_move_billing_account_rest_call_success(request_type):
94009429
assert response.display_name == "display_name_value"
94019430
assert response.master_billing_account == "master_billing_account_value"
94029431
assert response.parent == "parent_value"
9432+
assert response.currency_code == "currency_code_value"
94039433

94049434

94059435
@pytest.mark.parametrize("null_interceptor", [True, False])

0 commit comments

Comments
 (0)