/
repositories.py
1239 lines (1087 loc) · 37.4 KB
/
repositories.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations
from typing import MutableMapping, MutableSequence
from google.api import httpbody_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import proto # type: ignore
__protobuf__ = proto.module(
package="google.devtools.cloudbuild.v2",
manifest={
"Connection",
"InstallationState",
"FetchLinkableRepositoriesRequest",
"FetchLinkableRepositoriesResponse",
"GitHubConfig",
"GitHubEnterpriseConfig",
"GitLabConfig",
"BitbucketDataCenterConfig",
"BitbucketCloudConfig",
"ServiceDirectoryConfig",
"Repository",
"OAuthCredential",
"UserCredential",
"CreateConnectionRequest",
"GetConnectionRequest",
"ListConnectionsRequest",
"ListConnectionsResponse",
"UpdateConnectionRequest",
"DeleteConnectionRequest",
"CreateRepositoryRequest",
"BatchCreateRepositoriesRequest",
"BatchCreateRepositoriesResponse",
"GetRepositoryRequest",
"ListRepositoriesRequest",
"ListRepositoriesResponse",
"DeleteRepositoryRequest",
"FetchReadWriteTokenRequest",
"FetchReadTokenRequest",
"FetchReadTokenResponse",
"FetchReadWriteTokenResponse",
"ProcessWebhookRequest",
"FetchGitRefsRequest",
"FetchGitRefsResponse",
},
)
class Connection(proto.Message):
r"""A connection to a SCM like GitHub, GitHub Enterprise,
Bitbucket Data Center, Bitbucket Cloud or GitLab.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
name (str):
Immutable. The resource name of the connection, in the
format
``projects/{project}/locations/{location}/connections/{connection_id}``.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Server assigned timestamp for
when the connection was created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Server assigned timestamp for
when the connection was updated.
github_config (google.cloud.devtools.cloudbuild_v2.types.GitHubConfig):
Configuration for connections to github.com.
This field is a member of `oneof`_ ``connection_config``.
github_enterprise_config (google.cloud.devtools.cloudbuild_v2.types.GitHubEnterpriseConfig):
Configuration for connections to an instance
of GitHub Enterprise.
This field is a member of `oneof`_ ``connection_config``.
gitlab_config (google.cloud.devtools.cloudbuild_v2.types.GitLabConfig):
Configuration for connections to gitlab.com
or an instance of GitLab Enterprise.
This field is a member of `oneof`_ ``connection_config``.
bitbucket_data_center_config (google.cloud.devtools.cloudbuild_v2.types.BitbucketDataCenterConfig):
Configuration for connections to Bitbucket
Data Center.
This field is a member of `oneof`_ ``connection_config``.
bitbucket_cloud_config (google.cloud.devtools.cloudbuild_v2.types.BitbucketCloudConfig):
Configuration for connections to Bitbucket
Cloud.
This field is a member of `oneof`_ ``connection_config``.
installation_state (google.cloud.devtools.cloudbuild_v2.types.InstallationState):
Output only. Installation state of the
Connection.
disabled (bool):
If disabled is set to true, functionality is
disabled for this connection. Repository based
API methods and webhooks processing for
repositories in this connection will be
disabled.
reconciling (bool):
Output only. Set to true when the connection
is being set up or updated in the background.
annotations (MutableMapping[str, str]):
Allows clients to store small amounts of
arbitrary data.
etag (str):
This checksum is computed by the server based
on the value of other fields, and may be sent on
update and delete requests to ensure the client
has an up-to-date value before proceeding.
"""
name: str = proto.Field(
proto.STRING,
number=1,
)
create_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=3,
message=timestamp_pb2.Timestamp,
)
update_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=4,
message=timestamp_pb2.Timestamp,
)
github_config: "GitHubConfig" = proto.Field(
proto.MESSAGE,
number=5,
oneof="connection_config",
message="GitHubConfig",
)
github_enterprise_config: "GitHubEnterpriseConfig" = proto.Field(
proto.MESSAGE,
number=6,
oneof="connection_config",
message="GitHubEnterpriseConfig",
)
gitlab_config: "GitLabConfig" = proto.Field(
proto.MESSAGE,
number=7,
oneof="connection_config",
message="GitLabConfig",
)
bitbucket_data_center_config: "BitbucketDataCenterConfig" = proto.Field(
proto.MESSAGE,
number=8,
oneof="connection_config",
message="BitbucketDataCenterConfig",
)
bitbucket_cloud_config: "BitbucketCloudConfig" = proto.Field(
proto.MESSAGE,
number=9,
oneof="connection_config",
message="BitbucketCloudConfig",
)
installation_state: "InstallationState" = proto.Field(
proto.MESSAGE,
number=12,
message="InstallationState",
)
disabled: bool = proto.Field(
proto.BOOL,
number=13,
)
reconciling: bool = proto.Field(
proto.BOOL,
number=14,
)
annotations: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=15,
)
etag: str = proto.Field(
proto.STRING,
number=16,
)
class InstallationState(proto.Message):
r"""Describes stage and necessary actions to be taken by the
user to complete the installation. Used for GitHub and GitHub
Enterprise based connections.
Attributes:
stage (google.cloud.devtools.cloudbuild_v2.types.InstallationState.Stage):
Output only. Current step of the installation
process.
message (str):
Output only. Message of what the user should
do next to continue the installation. Empty
string if the installation is already complete.
action_uri (str):
Output only. Link to follow for next action.
Empty string if the installation is already
complete.
"""
class Stage(proto.Enum):
r"""Stage of the installation process.
Values:
STAGE_UNSPECIFIED (0):
No stage specified.
PENDING_CREATE_APP (1):
Only for GitHub Enterprise. An App creation
has been requested. The user needs to confirm
the creation in their GitHub enterprise host.
PENDING_USER_OAUTH (2):
User needs to authorize the GitHub (or
Enterprise) App via OAuth.
PENDING_INSTALL_APP (3):
User needs to follow the link to install the
GitHub (or Enterprise) App.
COMPLETE (10):
Installation process has been completed.
"""
STAGE_UNSPECIFIED = 0
PENDING_CREATE_APP = 1
PENDING_USER_OAUTH = 2
PENDING_INSTALL_APP = 3
COMPLETE = 10
stage: Stage = proto.Field(
proto.ENUM,
number=1,
enum=Stage,
)
message: str = proto.Field(
proto.STRING,
number=2,
)
action_uri: str = proto.Field(
proto.STRING,
number=3,
)
class FetchLinkableRepositoriesRequest(proto.Message):
r"""Request message for FetchLinkableRepositories.
Attributes:
connection (str):
Required. The name of the Connection. Format:
``projects/*/locations/*/connections/*``.
page_size (int):
Number of results to return in the list.
Default to 20.
page_token (str):
Page start.
"""
connection: str = proto.Field(
proto.STRING,
number=1,
)
page_size: int = proto.Field(
proto.INT32,
number=2,
)
page_token: str = proto.Field(
proto.STRING,
number=3,
)
class FetchLinkableRepositoriesResponse(proto.Message):
r"""Response message for FetchLinkableRepositories.
Attributes:
repositories (MutableSequence[google.cloud.devtools.cloudbuild_v2.types.Repository]):
repositories ready to be created.
next_page_token (str):
A token identifying a page of results the
server should return.
"""
@property
def raw_page(self):
return self
repositories: MutableSequence["Repository"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="Repository",
)
next_page_token: str = proto.Field(
proto.STRING,
number=2,
)
class GitHubConfig(proto.Message):
r"""Configuration for connections to github.com.
Attributes:
authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.OAuthCredential):
OAuth credential of the account that
authorized the Cloud Build GitHub App. It is
recommended to use a robot account instead of a
human user account. The OAuth token must be tied
to the Cloud Build GitHub App.
app_installation_id (int):
GitHub App installation id.
"""
authorizer_credential: "OAuthCredential" = proto.Field(
proto.MESSAGE,
number=1,
message="OAuthCredential",
)
app_installation_id: int = proto.Field(
proto.INT64,
number=2,
)
class GitHubEnterpriseConfig(proto.Message):
r"""Configuration for connections to an instance of GitHub
Enterprise.
Attributes:
host_uri (str):
Required. The URI of the GitHub Enterprise
host this connection is for.
api_key (str):
Required. API Key used for authentication of
webhook events.
app_id (int):
Id of the GitHub App created from the
manifest.
app_slug (str):
The URL-friendly name of the GitHub App.
private_key_secret_version (str):
SecretManager resource containing the private key of the
GitHub App, formatted as
``projects/*/secrets/*/versions/*``.
webhook_secret_secret_version (str):
SecretManager resource containing the webhook secret of the
GitHub App, formatted as
``projects/*/secrets/*/versions/*``.
app_installation_id (int):
ID of the installation of the GitHub App.
service_directory_config (google.cloud.devtools.cloudbuild_v2.types.ServiceDirectoryConfig):
Configuration for using Service Directory to
privately connect to a GitHub Enterprise server.
This should only be set if the GitHub Enterprise
server is hosted on-premises and not reachable
by public internet. If this field is left empty,
calls to the GitHub Enterprise server will be
made over the public internet.
ssl_ca (str):
SSL certificate to use for requests to GitHub
Enterprise.
server_version (str):
Output only. GitHub Enterprise version installed at the
host_uri.
"""
host_uri: str = proto.Field(
proto.STRING,
number=1,
)
api_key: str = proto.Field(
proto.STRING,
number=12,
)
app_id: int = proto.Field(
proto.INT64,
number=2,
)
app_slug: str = proto.Field(
proto.STRING,
number=13,
)
private_key_secret_version: str = proto.Field(
proto.STRING,
number=4,
)
webhook_secret_secret_version: str = proto.Field(
proto.STRING,
number=5,
)
app_installation_id: int = proto.Field(
proto.INT64,
number=9,
)
service_directory_config: "ServiceDirectoryConfig" = proto.Field(
proto.MESSAGE,
number=10,
message="ServiceDirectoryConfig",
)
ssl_ca: str = proto.Field(
proto.STRING,
number=11,
)
server_version: str = proto.Field(
proto.STRING,
number=14,
)
class GitLabConfig(proto.Message):
r"""Configuration for connections to gitlab.com or an instance of
GitLab Enterprise.
Attributes:
host_uri (str):
The URI of the GitLab Enterprise host this
connection is for. If not specified, the default
value is https://gitlab.com.
webhook_secret_secret_version (str):
Required. Immutable. SecretManager resource containing the
webhook secret of a GitLab Enterprise project, formatted as
``projects/*/secrets/*/versions/*``.
read_authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. A GitLab personal access token with the minimum
``read_api`` scope access.
authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. A GitLab personal access token with the ``api``
scope access.
service_directory_config (google.cloud.devtools.cloudbuild_v2.types.ServiceDirectoryConfig):
Configuration for using Service Directory to
privately connect to a GitLab Enterprise server.
This should only be set if the GitLab Enterprise
server is hosted on-premises and not reachable
by public internet. If this field is left empty,
calls to the GitLab Enterprise server will be
made over the public internet.
ssl_ca (str):
SSL certificate to use for requests to GitLab
Enterprise.
server_version (str):
Output only. Version of the GitLab Enterprise server running
on the ``host_uri``.
"""
host_uri: str = proto.Field(
proto.STRING,
number=1,
)
webhook_secret_secret_version: str = proto.Field(
proto.STRING,
number=2,
)
read_authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=3,
message="UserCredential",
)
authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=4,
message="UserCredential",
)
service_directory_config: "ServiceDirectoryConfig" = proto.Field(
proto.MESSAGE,
number=5,
message="ServiceDirectoryConfig",
)
ssl_ca: str = proto.Field(
proto.STRING,
number=6,
)
server_version: str = proto.Field(
proto.STRING,
number=7,
)
class BitbucketDataCenterConfig(proto.Message):
r"""Configuration for connections to Bitbucket Data Center.
Attributes:
host_uri (str):
Required. The URI of the Bitbucket Data
Center instance or cluster this connection is
for.
webhook_secret_secret_version (str):
Required. Immutable. SecretManager resource containing the
webhook secret used to verify webhook events, formatted as
``projects/*/secrets/*/versions/*``.
read_authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. A http access token with the ``REPO_READ`` access.
authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. A http access token with the ``REPO_ADMIN`` scope
access.
service_directory_config (google.cloud.devtools.cloudbuild_v2.types.ServiceDirectoryConfig):
Optional. Configuration for using Service
Directory to privately connect to a Bitbucket
Data Center. This should only be set if the
Bitbucket Data Center is hosted on-premises and
not reachable by public internet. If this field
is left empty, calls to the Bitbucket Data
Center will be made over the public internet.
ssl_ca (str):
Optional. SSL certificate to use for requests
to the Bitbucket Data Center.
server_version (str):
Output only. Version of the Bitbucket Data Center running on
the ``host_uri``.
"""
host_uri: str = proto.Field(
proto.STRING,
number=1,
)
webhook_secret_secret_version: str = proto.Field(
proto.STRING,
number=2,
)
read_authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=3,
message="UserCredential",
)
authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=4,
message="UserCredential",
)
service_directory_config: "ServiceDirectoryConfig" = proto.Field(
proto.MESSAGE,
number=5,
message="ServiceDirectoryConfig",
)
ssl_ca: str = proto.Field(
proto.STRING,
number=6,
)
server_version: str = proto.Field(
proto.STRING,
number=7,
)
class BitbucketCloudConfig(proto.Message):
r"""Configuration for connections to Bitbucket Cloud.
Attributes:
workspace (str):
Required. The Bitbucket Cloud Workspace ID to
be connected to Google Cloud Platform.
webhook_secret_secret_version (str):
Required. SecretManager resource containing the webhook
secret used to verify webhook events, formatted as
``projects/*/secrets/*/versions/*``.
read_authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. An access token with the ``repository`` access. It
can be either a workspace, project or repository access
token. It's recommended to use a system account to generate
the credentials.
authorizer_credential (google.cloud.devtools.cloudbuild_v2.types.UserCredential):
Required. An access token with the ``webhook``,
``repository``, ``repository:admin`` and ``pullrequest``
scope access. It can be either a workspace, project or
repository access token. It's recommended to use a system
account to generate these credentials.
"""
workspace: str = proto.Field(
proto.STRING,
number=1,
)
webhook_secret_secret_version: str = proto.Field(
proto.STRING,
number=2,
)
read_authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=3,
message="UserCredential",
)
authorizer_credential: "UserCredential" = proto.Field(
proto.MESSAGE,
number=4,
message="UserCredential",
)
class ServiceDirectoryConfig(proto.Message):
r"""ServiceDirectoryConfig represents Service Directory
configuration for a connection.
Attributes:
service (str):
Required. The Service Directory service name.
Format:
projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
"""
service: str = proto.Field(
proto.STRING,
number=1,
)
class Repository(proto.Message):
r"""A repository associated to a parent connection.
Attributes:
name (str):
Immutable. Resource name of the repository, in the format
``projects/*/locations/*/connections/*/repositories/*``.
remote_uri (str):
Required. Git Clone HTTPS URI.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Server assigned timestamp for
when the connection was created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Server assigned timestamp for
when the connection was updated.
annotations (MutableMapping[str, str]):
Allows clients to store small amounts of
arbitrary data.
etag (str):
This checksum is computed by the server based
on the value of other fields, and may be sent on
update and delete requests to ensure the client
has an up-to-date value before proceeding.
webhook_id (str):
Output only. External ID of the webhook
created for the repository.
"""
name: str = proto.Field(
proto.STRING,
number=1,
)
remote_uri: str = proto.Field(
proto.STRING,
number=2,
)
create_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=4,
message=timestamp_pb2.Timestamp,
)
update_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=5,
message=timestamp_pb2.Timestamp,
)
annotations: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=6,
)
etag: str = proto.Field(
proto.STRING,
number=7,
)
webhook_id: str = proto.Field(
proto.STRING,
number=8,
)
class OAuthCredential(proto.Message):
r"""Represents an OAuth token of the account that authorized the
Connection, and associated metadata.
Attributes:
oauth_token_secret_version (str):
A SecretManager resource containing the OAuth token that
authorizes the Cloud Build connection. Format:
``projects/*/secrets/*/versions/*``.
username (str):
Output only. The username associated to this
token.
"""
oauth_token_secret_version: str = proto.Field(
proto.STRING,
number=1,
)
username: str = proto.Field(
proto.STRING,
number=2,
)
class UserCredential(proto.Message):
r"""Represents a personal access token that authorized the
Connection, and associated metadata.
Attributes:
user_token_secret_version (str):
Required. A SecretManager resource containing the user token
that authorizes the Cloud Build connection. Format:
``projects/*/secrets/*/versions/*``.
username (str):
Output only. The username associated to this
token.
"""
user_token_secret_version: str = proto.Field(
proto.STRING,
number=1,
)
username: str = proto.Field(
proto.STRING,
number=2,
)
class CreateConnectionRequest(proto.Message):
r"""Message for creating a Connection
Attributes:
parent (str):
Required. Project and location where the connection will be
created. Format: ``projects/*/locations/*``.
connection (google.cloud.devtools.cloudbuild_v2.types.Connection):
Required. The Connection to create.
connection_id (str):
Required. The ID to use for the Connection, which will
become the final component of the Connection's resource
name. Names must be unique per-project per-location. Allows
alphanumeric characters and any of -._~%!$&'()*+,;=@.
"""
parent: str = proto.Field(
proto.STRING,
number=1,
)
connection: "Connection" = proto.Field(
proto.MESSAGE,
number=2,
message="Connection",
)
connection_id: str = proto.Field(
proto.STRING,
number=3,
)
class GetConnectionRequest(proto.Message):
r"""Message for getting the details of a Connection.
Attributes:
name (str):
Required. The name of the Connection to retrieve. Format:
``projects/*/locations/*/connections/*``.
"""
name: str = proto.Field(
proto.STRING,
number=1,
)
class ListConnectionsRequest(proto.Message):
r"""Message for requesting list of Connections.
Attributes:
parent (str):
Required. The parent, which owns this collection of
Connections. Format: ``projects/*/locations/*``.
page_size (int):
Number of results to return in the list.
page_token (str):
Page start.
"""
parent: str = proto.Field(
proto.STRING,
number=1,
)
page_size: int = proto.Field(
proto.INT32,
number=2,
)
page_token: str = proto.Field(
proto.STRING,
number=3,
)
class ListConnectionsResponse(proto.Message):
r"""Message for response to listing Connections.
Attributes:
connections (MutableSequence[google.cloud.devtools.cloudbuild_v2.types.Connection]):
The list of Connections.
next_page_token (str):
A token identifying a page of results the
server should return.
"""
@property
def raw_page(self):
return self
connections: MutableSequence["Connection"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="Connection",
)
next_page_token: str = proto.Field(
proto.STRING,
number=2,
)
class UpdateConnectionRequest(proto.Message):
r"""Message for updating a Connection.
Attributes:
connection (google.cloud.devtools.cloudbuild_v2.types.Connection):
Required. The Connection to update.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
The list of fields to be updated.
allow_missing (bool):
If set to true, and the connection is not found a new
connection will be created. In this situation
``update_mask`` is ignored. The creation will succeed only
if the input connection has all the necessary information
(e.g a github_config with both user_oauth_token and
installation_id properties).
etag (str):
The current etag of the connection.
If an etag is provided and does not match the
current etag of the connection, update will be
blocked and an ABORTED error will be returned.
"""
connection: "Connection" = proto.Field(
proto.MESSAGE,
number=1,
message="Connection",
)
update_mask: field_mask_pb2.FieldMask = proto.Field(
proto.MESSAGE,
number=2,
message=field_mask_pb2.FieldMask,
)
allow_missing: bool = proto.Field(
proto.BOOL,
number=3,
)
etag: str = proto.Field(
proto.STRING,
number=4,
)
class DeleteConnectionRequest(proto.Message):
r"""Message for deleting a Connection.
Attributes:
name (str):
Required. The name of the Connection to delete. Format:
``projects/*/locations/*/connections/*``.
etag (str):
The current etag of the connection.
If an etag is provided and does not match the
current etag of the connection, deletion will be
blocked and an ABORTED error will be returned.
validate_only (bool):
If set, validate the request, but do not
actually post it.
"""
name: str = proto.Field(
proto.STRING,
number=1,
)
etag: str = proto.Field(
proto.STRING,
number=2,
)
validate_only: bool = proto.Field(
proto.BOOL,
number=3,
)
class CreateRepositoryRequest(proto.Message):
r"""Message for creating a Repository.
Attributes:
parent (str):
Required. The connection to contain the
repository. If the request is part of a
BatchCreateRepositoriesRequest, this field
should be empty or match the parent specified
there.
repository (google.cloud.devtools.cloudbuild_v2.types.Repository):
Required. The repository to create.
repository_id (str):
Required. The ID to use for the repository, which will
become the final component of the repository's resource
name. This ID should be unique in the connection. Allows
alphanumeric characters and any of -._~%!$&'()*+,;=@.
"""
parent: str = proto.Field(
proto.STRING,
number=1,
)
repository: "Repository" = proto.Field(
proto.MESSAGE,
number=2,
message="Repository",
)
repository_id: str = proto.Field(
proto.STRING,
number=3,
)
class BatchCreateRepositoriesRequest(proto.Message):
r"""Message for creating repositoritories in batch.
Attributes:
parent (str):
Required. The connection to contain all the repositories
being created. Format:
projects/\ */locations/*/connections/\* The parent field in
the CreateRepositoryRequest messages must either be empty or
match this field.
requests (MutableSequence[google.cloud.devtools.cloudbuild_v2.types.CreateRepositoryRequest]):
Required. The request messages specifying the
repositories to create.
"""
parent: str = proto.Field(
proto.STRING,
number=1,
)
requests: MutableSequence["CreateRepositoryRequest"] = proto.RepeatedField(
proto.MESSAGE,
number=2,
message="CreateRepositoryRequest",
)
class BatchCreateRepositoriesResponse(proto.Message):
r"""Message for response of creating repositories in batch.
Attributes:
repositories (MutableSequence[google.cloud.devtools.cloudbuild_v2.types.Repository]):
Repository resources created.
"""
repositories: MutableSequence["Repository"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="Repository",
)
class GetRepositoryRequest(proto.Message):
r"""Message for getting the details of a Repository.
Attributes:
name (str):
Required. The name of the Repository to retrieve. Format:
``projects/*/locations/*/connections/*/repositories/*``.
"""
name: str = proto.Field(
proto.STRING,
number=1,
)
class ListRepositoriesRequest(proto.Message):
r"""Message for requesting list of Repositories.
Attributes:
parent (str):
Required. The parent, which owns this collection of
Repositories. Format:
``projects/*/locations/*/connections/*``.
page_size (int):
Number of results to return in the list.