@@ -60,14 +60,14 @@ def __init__(self, name: str = ""): |
60 | 60 |
|
61 | 61 | def log_create_with_lro( |
62 | 62 | self, |
63 | | - cls: Type["AiPlatformResourceNoun"], |
| 63 | + cls: Type["VertexAiResourceNoun"], |
64 | 64 | lro: Optional[operation.Operation] = None, |
65 | 65 | ): |
66 | 66 | """Logs create event with LRO. |
67 | 67 |
|
68 | 68 | Args: |
69 | | - cls (AiPlatformResourceNoune): |
70 | | - AI Platform Resource Noun class that is being created. |
| 69 | + cls (VertexAiResourceNoun): |
| 70 | + Vertex AI Resource Noun class that is being created. |
71 | 71 | lro (operation.Operation): |
72 | 72 | Optional. Backing LRO for creation. |
73 | 73 | """ |
@@ -80,7 +80,7 @@ def log_create_with_lro( |
80 | 80 |
|
81 | 81 | def log_create_complete( |
82 | 82 | self, |
83 | | - cls: Type["AiPlatformResourceNoun"], |
| 83 | + cls: Type["VertexAiResourceNoun"], |
84 | 84 | resource: proto.Message, |
85 | 85 | variable_name: str, |
86 | 86 | ): |
@@ -89,10 +89,10 @@ def log_create_complete( |
89 | 89 | Will also include code snippet to instantiate resource in SDK. |
90 | 90 |
|
91 | 91 | Args: |
92 | | - cls (AiPlatformResourceNoun): |
93 | | - AI Platform Resource Noun class that is being created. |
| 92 | + cls (VertexAiResourceNoun): |
| 93 | + Vertex AI Resource Noun class that is being created. |
94 | 94 | resource (proto.Message): |
95 | | - AI Platform Resourc proto.Message |
| 95 | + Vertex AI Resourc proto.Message |
96 | 96 | variable_name (str): Name of variable to use for code snippet |
97 | 97 | """ |
98 | 98 | self._logger.info(f"{cls.__name__} created. Resource name: {resource.name}") |
@@ -103,7 +103,7 @@ def log_create_complete( |
103 | 103 |
|
104 | 104 | def log_create_complete_with_getter( |
105 | 105 | self, |
106 | | - cls: Type["AiPlatformResourceNoun"], |
| 106 | + cls: Type["VertexAiResourceNoun"], |
107 | 107 | resource: proto.Message, |
108 | 108 | variable_name: str, |
109 | 109 | ): |
@@ -112,10 +112,10 @@ def log_create_complete_with_getter( |
112 | 112 | Will also include code snippet to instantiate resource in SDK. |
113 | 113 |
|
114 | 114 | Args: |
115 | | - cls (AiPlatformResourceNoun): |
116 | | - AI Platform Resource Noun class that is being created. |
| 115 | + cls (VertexAiResourceNoun): |
| 116 | + Vertex AI Resource Noun class that is being created. |
117 | 117 | resource (proto.Message): |
118 | | - AI Platform Resourc proto.Message |
| 118 | + Vertex AI Resourc proto.Message |
119 | 119 | variable_name (str): Name of variable to use for code snippet |
120 | 120 | """ |
121 | 121 | self._logger.info(f"{cls.__name__} created. Resource name: {resource.name}") |
@@ -125,14 +125,14 @@ def log_create_complete_with_getter( |
125 | 125 | ) |
126 | 126 |
|
127 | 127 | def log_action_start_against_resource( |
128 | | - self, action: str, noun: str, resource_noun_obj: "AiPlatformResourceNoun" |
| 128 | + self, action: str, noun: str, resource_noun_obj: "VertexAiResourceNoun" |
129 | 129 | ): |
130 | 130 | """Logs intention to start an action against a resource. |
131 | 131 |
|
132 | 132 | Args: |
133 | 133 | action (str): Action to complete against the resource ie: "Deploying". Can be empty string. |
134 | 134 | noun (str): Noun the action acts on against the resource. Can be empty string. |
135 | | - resource_noun_obj (AiPlatformResourceNoun): |
| 135 | + resource_noun_obj (VertexAiResourceNoun): |
136 | 136 | Resource noun object the action is acting against. |
137 | 137 | """ |
138 | 138 | self._logger.info( |
@@ -143,15 +143,15 @@ def log_action_started_against_resource_with_lro( |
143 | 143 | self, |
144 | 144 | action: str, |
145 | 145 | noun: str, |
146 | | - cls: Type["AiPlatformResourceNoun"], |
| 146 | + cls: Type["VertexAiResourceNoun"], |
147 | 147 | lro: operation.Operation, |
148 | 148 | ): |
149 | 149 | """Logs an action started against a resource with lro. |
150 | 150 |
|
151 | 151 | Args: |
152 | 152 | action (str): Action started against resource. ie: "Deploy". Can be empty string. |
153 | 153 | noun (str): Noun the action acts on against the resource. Can be empty string. |
154 | | - cls (AiPlatformResourceNoun): |
| 154 | + cls (VertexAiResourceNoun): |
155 | 155 | Resource noun object the action is acting against. |
156 | 156 | lro (operation.Operation): Backing LRO for action. |
157 | 157 | """ |
@@ -160,14 +160,14 @@ def log_action_started_against_resource_with_lro( |
160 | 160 | ) |
161 | 161 |
|
162 | 162 | def log_action_completed_against_resource( |
163 | | - self, noun: str, action: str, resource_noun_obj: "AiPlatformResourceNoun" |
| 163 | + self, noun: str, action: str, resource_noun_obj: "VertexAiResourceNoun" |
164 | 164 | ): |
165 | 165 | """Logs action completed against resource. |
166 | 166 |
|
167 | 167 | Args: |
168 | 168 | noun (str): Noun the action acts on against the resource. Can be empty string. |
169 | 169 | action (str): Action started against resource. ie: "Deployed". Can be empty string. |
170 | | - resource_noun_obj (AiPlatformResourceNoun): |
| 170 | + resource_noun_obj (VertexAiResourceNoun): |
171 | 171 | Resource noun object the action is acting against |
172 | 172 | """ |
173 | 173 | self._logger.info( |
@@ -385,8 +385,8 @@ def __repr__(self) -> str: |
385 | 385 | return object.__repr__(self) |
386 | 386 |
|
387 | 387 |
|
388 | | -class AiPlatformResourceNoun(metaclass=abc.ABCMeta): |
389 | | - """Base class the AI Platform resource nouns. |
| 388 | +class VertexAiResourceNoun(metaclass=abc.ABCMeta): |
| 389 | + """Base class the Vertex AI resource nouns. |
390 | 390 |
|
391 | 391 | Subclasses require two class attributes: |
392 | 392 |
|
@@ -400,7 +400,7 @@ class AiPlatformResourceNoun(metaclass=abc.ABCMeta): |
400 | 400 | @property |
401 | 401 | @classmethod |
402 | 402 | @abc.abstractmethod |
403 | | - def client_class(cls) -> Type[utils.AiPlatformServiceClientWithOverride]: |
| 403 | + def client_class(cls) -> Type[utils.VertexAiServiceClientWithOverride]: |
404 | 404 | """Client class required to interact with resource with optional |
405 | 405 | overrides.""" |
406 | 406 | pass |
@@ -464,7 +464,7 @@ def _instantiate_client( |
464 | 464 | cls, |
465 | 465 | location: Optional[str] = None, |
466 | 466 | credentials: Optional[auth_credentials.Credentials] = None, |
467 | | - ) -> utils.AiPlatformServiceClientWithOverride: |
| 467 | + ) -> utils.VertexAiServiceClientWithOverride: |
468 | 468 | """Helper method to instantiate service client for resource noun. |
469 | 469 |
|
470 | 470 | Args: |
@@ -473,7 +473,7 @@ def _instantiate_client( |
473 | 473 | Optional custom credentials to use when accessing interacting with |
474 | 474 | resource noun. |
475 | 475 | Returns: |
476 | | - client (utils.AiPlatformServiceClientWithOverride): |
| 476 | + client (utils.VertexAiServiceClientWithOverride): |
477 | 477 | Initialized service client for this service noun with optional overrides. |
478 | 478 | """ |
479 | 479 | return initializer.global_config.create_client( |
@@ -580,7 +580,7 @@ def optional_sync( |
580 | 580 | return_input_arg: Optional[str] = None, |
581 | 581 | bind_future_to_self: bool = True, |
582 | 582 | ): |
583 | | - """Decorator for AiPlatformResourceNounWithFutureManager with optional sync |
| 583 | + """Decorator for VertexAiResourceNounWithFutureManager with optional sync |
584 | 584 | support. |
585 | 585 |
|
586 | 586 | Methods with this decorator should include a "sync" argument that defaults to |
@@ -714,8 +714,8 @@ def wrapper(*args, **kwargs): |
714 | 714 | return optional_run_in_thread |
715 | 715 |
|
716 | 716 |
|
717 | | -class AiPlatformResourceNounWithFutureManager(AiPlatformResourceNoun, FutureManager): |
718 | | - """Allows optional asynchronous calls to this AI Platform Resource |
| 717 | +class VertexAiResourceNounWithFutureManager(VertexAiResourceNoun, FutureManager): |
| 718 | + """Allows optional asynchronous calls to this Vertex AI Resource |
719 | 719 | Nouns.""" |
720 | 720 |
|
721 | 721 | def __init__( |
@@ -735,7 +735,7 @@ def __init__( |
735 | 735 | resource noun. |
736 | 736 | resource_name(str): A fully-qualified resource name or ID. |
737 | 737 | """ |
738 | | - AiPlatformResourceNoun.__init__( |
| 738 | + VertexAiResourceNoun.__init__( |
739 | 739 | self, |
740 | 740 | project=project, |
741 | 741 | location=location, |
@@ -751,7 +751,7 @@ def _empty_constructor( |
751 | 751 | location: Optional[str] = None, |
752 | 752 | credentials: Optional[auth_credentials.Credentials] = None, |
753 | 753 | resource_name: Optional[str] = None, |
754 | | - ) -> "AiPlatformResourceNounWithFutureManager": |
| 754 | + ) -> "VertexAiResourceNounWithFutureManager": |
755 | 755 | """Initializes with all attributes set to None. |
756 | 756 |
|
757 | 757 | The attributes should be populated after a future is complete. This allows |
@@ -768,7 +768,7 @@ def _empty_constructor( |
768 | 768 | An instance of this class with attributes set to None. |
769 | 769 | """ |
770 | 770 | self = cls.__new__(cls) |
771 | | - AiPlatformResourceNoun.__init__( |
| 771 | + VertexAiResourceNoun.__init__( |
772 | 772 | self, |
773 | 773 | project=project, |
774 | 774 | location=location, |
@@ -780,12 +780,12 @@ def _empty_constructor( |
780 | 780 | return self |
781 | 781 |
|
782 | 782 | def _sync_object_with_future_result( |
783 | | - self, result: "AiPlatformResourceNounWithFutureManager" |
| 783 | + self, result: "VertexAiResourceNounWithFutureManager" |
784 | 784 | ): |
785 | 785 | """Populates attributes from a Future result to this object. |
786 | 786 |
|
787 | 787 | Args: |
788 | | - result: AiPlatformResourceNounWithFutureManager |
| 788 | + result: VertexAiResourceNounWithFutureManager |
789 | 789 | Required. Result of future with same type as this object. |
790 | 790 | """ |
791 | 791 | sync_attributes = [ |
@@ -811,12 +811,12 @@ def _construct_sdk_resource_from_gapic( |
811 | 811 | project: Optional[str] = None, |
812 | 812 | location: Optional[str] = None, |
813 | 813 | credentials: Optional[auth_credentials.Credentials] = None, |
814 | | - ) -> AiPlatformResourceNoun: |
| 814 | + ) -> VertexAiResourceNoun: |
815 | 815 | """Given a GAPIC resource object, return the SDK representation. |
816 | 816 |
|
817 | 817 | Args: |
818 | 818 | gapic_resource (proto.Message): |
819 | | - A GAPIC representation of an AI Platform resource, usually |
| 819 | + A GAPIC representation of an Vertex AI resource, usually |
820 | 820 | retrieved by a get_* or in a list_* API call. |
821 | 821 | project (str): |
822 | 822 | Optional. Project to construct SDK object from. If not set, |
@@ -829,7 +829,7 @@ def _construct_sdk_resource_from_gapic( |
829 | 829 | Overrides credentials set in aiplatform.init. |
830 | 830 |
|
831 | 831 | Returns: |
832 | | - AiPlatformResourceNoun: |
| 832 | + VertexAiResourceNoun: |
833 | 833 | An initialized SDK object that represents GAPIC type. |
834 | 834 | """ |
835 | 835 | sdk_resource = self._empty_constructor( |
@@ -849,8 +849,8 @@ def _list( |
849 | 849 | project: Optional[str] = None, |
850 | 850 | location: Optional[str] = None, |
851 | 851 | credentials: Optional[auth_credentials.Credentials] = None, |
852 | | - ) -> List[AiPlatformResourceNoun]: |
853 | | - """Private method to list all instances of this AI Platform Resource, |
| 852 | + ) -> List[VertexAiResourceNoun]: |
| 853 | + """Private method to list all instances of this Vertex AI Resource, |
854 | 854 | takes a `cls_filter` arg to filter to a particular SDK resource |
855 | 855 | subclass. |
856 | 856 |
|
@@ -878,7 +878,7 @@ def _list( |
878 | 878 | credentials set in aiplatform.init. |
879 | 879 |
|
880 | 880 | Returns: |
881 | | - List[AiPlatformResourceNoun] - A list of SDK resource objects |
| 881 | + List[VertexAiResourceNoun] - A list of SDK resource objects |
882 | 882 | """ |
883 | 883 | self = cls._empty_constructor( |
884 | 884 | project=project, location=location, credentials=credentials |
@@ -918,8 +918,8 @@ def _list_with_local_order( |
918 | 918 | project: Optional[str] = None, |
919 | 919 | location: Optional[str] = None, |
920 | 920 | credentials: Optional[auth_credentials.Credentials] = None, |
921 | | - ) -> List[AiPlatformResourceNoun]: |
922 | | - """Private method to list all instances of this AI Platform Resource, |
| 921 | + ) -> List[VertexAiResourceNoun]: |
| 922 | + """Private method to list all instances of this Vertex AI Resource, |
923 | 923 | takes a `cls_filter` arg to filter to a particular SDK resource |
924 | 924 | subclass. Provides client-side sorting when a list API doesn't support |
925 | 925 | `order_by`. |
@@ -948,7 +948,7 @@ def _list_with_local_order( |
948 | 948 | credentials set in aiplatform.init. |
949 | 949 |
|
950 | 950 | Returns: |
951 | | - List[AiPlatformResourceNoun] - A list of SDK resource objects |
| 951 | + List[VertexAiResourceNoun] - A list of SDK resource objects |
952 | 952 | """ |
953 | 953 |
|
954 | 954 | li = cls._list( |
@@ -980,8 +980,8 @@ def list( |
980 | 980 | project: Optional[str] = None, |
981 | 981 | location: Optional[str] = None, |
982 | 982 | credentials: Optional[auth_credentials.Credentials] = None, |
983 | | - ) -> List[AiPlatformResourceNoun]: |
984 | | - """List all instances of this AI Platform Resource. |
| 983 | + ) -> List[VertexAiResourceNoun]: |
| 984 | + """List all instances of this Vertex AI Resource. |
985 | 985 |
|
986 | 986 | Example Usage: |
987 | 987 |
|
@@ -1010,7 +1010,7 @@ def list( |
1010 | 1010 | credentials set in aiplatform.init. |
1011 | 1011 |
|
1012 | 1012 | Returns: |
1013 | | - List[AiPlatformResourceNoun] - A list of SDK resource objects |
| 1013 | + List[VertexAiResourceNoun] - A list of SDK resource objects |
1014 | 1014 | """ |
1015 | 1015 |
|
1016 | 1016 | return cls._list( |
@@ -1023,7 +1023,7 @@ def list( |
1023 | 1023 |
|
1024 | 1024 | @optional_sync() |
1025 | 1025 | def delete(self, sync: bool = True) -> None: |
1026 | | - """Deletes this AI Platform resource. WARNING: This deletion is |
| 1026 | + """Deletes this Vertex AI resource. WARNING: This deletion is |
1027 | 1027 | permament. |
1028 | 1028 |
|
1029 | 1029 | Args: |
@@ -1042,7 +1042,7 @@ def delete(self, sync: bool = True) -> None: |
1042 | 1042 |
|
1043 | 1043 | def __repr__(self) -> str: |
1044 | 1044 | if self._gca_resource: |
1045 | | - return AiPlatformResourceNoun.__repr__(self) |
| 1045 | + return VertexAiResourceNoun.__repr__(self) |
1046 | 1046 |
|
1047 | 1047 | return FutureManager.__repr__(self) |
1048 | 1048 |
|
|