Skip to content

Commit c7943db

Browse files
feat: [google-cloud-config] added support for service maintained provider (#14347)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 802269281 Source-Link: googleapis/googleapis@65afc22 Source-Link: googleapis/googleapis-gen@f7c9511 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZy8uT3dsQm90LnlhbWwiLCJoIjoiZjdjOTUxMWJlNWE4MmZjNmJlZDg1MzEwZjllN2VkMzkwZTU1ZWI0MSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 92212a5 commit c7943db

7 files changed

Lines changed: 68 additions & 3 deletions

File tree

packages/google-cloud-config/google/cloud/config/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
PreviewResult,
6767
PropertyChange,
6868
PropertyDrift,
69+
ProviderConfig,
6970
QuotaValidation,
7071
Resource,
7172
ResourceCAIInfo,
@@ -133,6 +134,7 @@
133134
"PreviewResult",
134135
"PropertyChange",
135136
"PropertyDrift",
137+
"ProviderConfig",
136138
"Resource",
137139
"ResourceCAIInfo",
138140
"ResourceChange",

packages/google-cloud-config/google/cloud/config_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
PreviewResult,
6666
PropertyChange,
6767
PropertyDrift,
68+
ProviderConfig,
6869
QuotaValidation,
6970
Resource,
7071
ResourceCAIInfo,
@@ -132,6 +133,7 @@
132133
"PreviewResult",
133134
"PropertyChange",
134135
"PropertyDrift",
136+
"ProviderConfig",
135137
"QuotaValidation",
136138
"Resource",
137139
"ResourceCAIInfo",

packages/google-cloud-config/google/cloud/config_v1/services/config/async_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
Type,
2929
Union,
3030
)
31-
import uuid
3231

3332
from google.api_core import exceptions as core_exceptions
3433
from google.api_core import gapic_v1

packages/google-cloud-config/google/cloud/config_v1/services/config/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
Union,
3333
cast,
3434
)
35-
import uuid
3635
import warnings
3736

3837
from google.api_core import client_options as client_options_lib

packages/google-cloud-config/google/cloud/config_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
PreviewResult,
6060
PropertyChange,
6161
PropertyDrift,
62+
ProviderConfig,
6263
QuotaValidation,
6364
Resource,
6465
ResourceCAIInfo,
@@ -124,6 +125,7 @@
124125
"PreviewResult",
125126
"PropertyChange",
126127
"PropertyDrift",
128+
"ProviderConfig",
127129
"Resource",
128130
"ResourceCAIInfo",
129131
"ResourceChange",

packages/google-cloud-config/google/cloud/config_v1/types/config.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"ListResourceDriftsRequest",
8989
"ListResourceDriftsResponse",
9090
"GetResourceDriftRequest",
91+
"ProviderConfig",
9192
},
9293
)
9394

@@ -238,6 +239,9 @@ class Deployment(proto.Message):
238239
deployments during automation. See
239240
https://google.aip.dev/148#annotations for
240241
details on format and size limitations.
242+
provider_config (google.cloud.config_v1.types.ProviderConfig):
243+
Optional. This field specifies the provider
244+
configurations.
241245
"""
242246

243247
class State(proto.Enum):
@@ -443,6 +447,11 @@ class LockState(proto.Enum):
443447
proto.STRING,
444448
number=24,
445449
)
450+
provider_config: "ProviderConfig" = proto.Field(
451+
proto.MESSAGE,
452+
number=25,
453+
message="ProviderConfig",
454+
)
446455

447456

448457
class TerraformBlueprint(proto.Message):
@@ -1161,6 +1170,9 @@ class Revision(proto.Message):
11611170
resources in terraform configuration files.
11621171
There are limited resources on which quota
11631172
validation applies.
1173+
provider_config (google.cloud.config_v1.types.ProviderConfig):
1174+
Output only. This field specifies the
1175+
provider configurations.
11641176
"""
11651177

11661178
class Action(proto.Enum):
@@ -1319,6 +1331,11 @@ class ErrorCode(proto.Enum):
13191331
number=20,
13201332
enum="QuotaValidation",
13211333
)
1334+
provider_config: "ProviderConfig" = proto.Field(
1335+
proto.MESSAGE,
1336+
number=21,
1337+
message="ProviderConfig",
1338+
)
13221339

13231340

13241341
class TerraformError(proto.Message):
@@ -2054,6 +2071,9 @@ class Preview(proto.Message):
20542071
preview during automation. See
20552072
https://google.aip.dev/148#annotations for
20562073
details on format and size limitations.
2074+
provider_config (google.cloud.config_v1.types.ProviderConfig):
2075+
Optional. This field specifies the provider
2076+
configurations.
20572077
"""
20582078

20592079
class State(proto.Enum):
@@ -2237,6 +2257,11 @@ class ErrorCode(proto.Enum):
22372257
proto.STRING,
22382258
number=20,
22392259
)
2260+
provider_config: "ProviderConfig" = proto.Field(
2261+
proto.MESSAGE,
2262+
number=21,
2263+
message="ProviderConfig",
2264+
)
22402265

22412266

22422267
class PreviewOperationMetadata(proto.Message):
@@ -3255,4 +3280,38 @@ class GetResourceDriftRequest(proto.Message):
32553280
)
32563281

32573282

3283+
class ProviderConfig(proto.Message):
3284+
r"""ProviderConfig contains the provider configurations.
3285+
3286+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
3287+
3288+
Attributes:
3289+
source_type (google.cloud.config_v1.types.ProviderConfig.ProviderSource):
3290+
Optional. ProviderSource specifies the source
3291+
type of the provider.
3292+
3293+
This field is a member of `oneof`_ ``_source_type``.
3294+
"""
3295+
3296+
class ProviderSource(proto.Enum):
3297+
r"""ProviderSource represents the source type of the provider.
3298+
3299+
Values:
3300+
PROVIDER_SOURCE_UNSPECIFIED (0):
3301+
Unspecified source type, default to public
3302+
sources.
3303+
SERVICE_MAINTAINED (1):
3304+
Service maintained provider source type.
3305+
"""
3306+
PROVIDER_SOURCE_UNSPECIFIED = 0
3307+
SERVICE_MAINTAINED = 1
3308+
3309+
source_type: ProviderSource = proto.Field(
3310+
proto.ENUM,
3311+
number=1,
3312+
optional=True,
3313+
enum=ProviderSource,
3314+
)
3315+
3316+
32583317
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-config/tests/unit/gapic/config_v1/test_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515
#
1616
import os
17-
import re
1817

1918
# try/except added for compatibility with python < 3.8
2019
try:
@@ -18835,6 +18834,7 @@ def test_create_deployment_rest_call_success(request_type):
1883518834
"tf_version": "tf_version_value",
1883618835
"quota_validation": 1,
1883718836
"annotations": {},
18837+
"provider_config": {"source_type": 1},
1883818838
}
1883918839
# The version of a generated dependency at test runtime may differ from the version used during generation.
1884018840
# Delete any fields which are not present in the current runtime dependency
@@ -19078,6 +19078,7 @@ def test_update_deployment_rest_call_success(request_type):
1907819078
"tf_version": "tf_version_value",
1907919079
"quota_validation": 1,
1908019080
"annotations": {},
19081+
"provider_config": {"source_type": 1},
1908119082
}
1908219083
# The version of a generated dependency at test runtime may differ from the version used during generation.
1908319084
# Delete any fields which are not present in the current runtime dependency
@@ -20812,6 +20813,7 @@ def test_create_preview_rest_call_success(request_type):
2081220813
"tf_version": "tf_version_value",
2081320814
"tf_version_constraint": "tf_version_constraint_value",
2081420815
"annotations": {},
20816+
"provider_config": {"source_type": 1},
2081520817
}
2081620818
# The version of a generated dependency at test runtime may differ from the version used during generation.
2081720819
# Delete any fields which are not present in the current runtime dependency

0 commit comments

Comments
 (0)