### Instantiate GoogleCloudAiplatformV1ToolParameterKVMatchInstance Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1TuningJob-class Demonstrates how to create an instance of GoogleCloudAiplatformV1ToolParameterKVMatchInstance using its constructor. ```Python from google.cloud.aiplatform.models.schema.aiplatform.v1 import tool_parameter_kv_match_instance kv_match_instance = tool_parameter_kv_match_instance.GoogleCloudAiplatformV1ToolParameterKVMatchInstance( key='example_key', value='example_value' ) ``` -------------------------------- ### Dart - toString Example Source: https://pub.dev/documentation/googleapis/latest/gkehub_v1/ResourceManifest-class Example of getting a string representation of an object in Dart. ```dart var stringRepresentation = instance.toString(); ``` -------------------------------- ### Dart - hashCode Example Source: https://pub.dev/documentation/googleapis/latest/gkehub_v1/ResourceManifest-class Example of getting the hash code of an object in Dart. ```dart var hash = instance.hashCode; ``` -------------------------------- ### Instantiate GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec-class Demonstrates how to create a new instance of the GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec class with optional parameters. ```dart GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec.new({ String? learningRateParameterName, String? maxStepCount, String? minMeasurementCount, String? minStepCount, bool? updateAllStoppedTrials, bool? useElapsedDuration, }) ``` -------------------------------- ### Dart - runtimeType Example Source: https://pub.dev/documentation/googleapis/latest/gkehub_v1/ResourceManifest-class Example of getting the runtime type of an object in Dart. ```dart var type = instance.runtimeType; ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2ListServingConfigsResponse-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Dialogflow V2: Few-Shot Example Source: https://pub.dev/documentation/googleapis/latest/dialogflow_v2 Provides examples for few-shot learning in Dialogflow V2's generative models. Including examples helps guide the LLM to produce responses in the desired format. ```Python from google.cloud import dialogflow_v2 def create_few_shot_example(input_text: str, output_text: str): # This is a conceptual example. Actual API usage involves providing these examples when configuring a generator. few_shot_example = dialogflow_v2.FewShotExample( input_text=input_text, output_text=output_text ) print(f"Few-shot example created: {few_shot_example}") # Example usage: # create_few_shot_example("What is the weather today?", "The weather today is sunny with a high of 75 degrees.") ``` -------------------------------- ### GoogleCloudAiplatformV1Examples Constructor Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1Examples-class Constructs a GoogleCloudAiplatformV1Examples object. It allows setting the Cloud Storage source for examples, nearest neighbor search configuration, the number of neighbors to return, and simplified preset configurations. ```dart GoogleCloudAiplatformV1Examples.new({ GoogleCloudAiplatformV1ExamplesExampleGcsSource? exampleGcsSource, Object? nearestNeighborSearchConfig, int? neighborCount, GoogleCloudAiplatformV1Presets? presets, }) ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1GroundingChunkWeb-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### HttpRule GET Mapping Example Source: https://pub.dev/documentation/googleapis/latest/servicemanagement_v1/HttpRule-class Defines a gRPC GET method mapping to an HTTP GET endpoint. The 'name' field from GetMessageRequest is mapped to the URL path. This allows REST clients to call the gRPC service using a standard HTTP GET request. ```protobuf service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = { get: "/v1/{name=messages / * }" }; } } message GetMessageRequest { string name = 1; // Mapped to URL path. } message Message { string text = 1; // The resource content. } ``` -------------------------------- ### Instantiate GoogleCloudRetailV2ListServingConfigsResponse Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2ListServingConfigsResponse-class Demonstrates how to create a new instance of the GoogleCloudRetailV2ListServingConfigsResponse class, optionally providing a nextPageToken and a list of servingConfigs. ```dart GoogleCloudRetailV2ListServingConfigsResponse.new(nextPageToken: 'token123', servingConfigs: [servingConfig1, servingConfig2]) ``` -------------------------------- ### Object Get Method Example Source: https://pub.dev/documentation/googleapis/latest/content_v2_1/CollectionstatusesResource-class Illustrates the usage of a `get` method, which is commonly used to retrieve specific data or resources from an API or object. ```Dart // Example of using a get method // var data = instance.get('some_id'); ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1TuningJob-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Start Cluster Request (Python) Source: https://pub.dev/documentation/googleapis/latest/dataproc_v1/PySparkBatch-class Shows a Python example for starting a stopped Dataproc cluster. Similar to stopping, it requires cluster name and project/region. ```python from google.cloud import dataproc_v1 as dataproc client = dataproc.ClusterControllerClient() project_id = 'your-project-id' region = 'us-central1' cluster_name = 'my-cluster-to-start' operation = client.start_cluster(project_id=project_id, region=region, cluster_name=cluster_name) operation.result() # Waits for the operation to complete. ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2BigQuerySource-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Start Runtime (AI Platform) Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/ProjectsLocationsNotebookRuntimesResource-class Provides an example of how to start a runtime environment for AI Platform Notebooks. This operation typically requires specifying the runtime identifier. ```Python from google.cloud import aiplatform def start_runtime(project_id, location, runtime_name): client_options = {"api_endpoint": f"{location}-aiplatform.googleapis.com"} aiplatform.init(project=project_id, client_options=client_options) # Example: Starting a notebook runtime runtime = aiplatform.NotebookRuntime(runtime_name) operation = runtime.start() print(f"Starting runtime operation: {operation.operation.name}") # Replace with your project ID, location, and runtime name # start_runtime("your-project-id", "us-central1", "your-runtime-id") ``` -------------------------------- ### Start Cluster Request Example Source: https://pub.dev/documentation/googleapis/latest/dataproc_v1/PySparkBatch-class Illustrates creating a `StartClusterRequest` to start a stopped Dataproc cluster. Similar to stopping, it requires cluster name and project/region details. ```java StartClusterRequest startRequest = new StartClusterRequest(); startRequest.setClusterName("my-dataproc-cluster"); // Project and region are typically part of the API call context. ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2SearchResponseFacet-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Dart Class hashCode Example Source: https://pub.dev/documentation/googleapis/latest/documentai_v1/GoogleCloudDocumentaiV1ProcessOptionsIndividualPageSelector-class Illustrates how to get the hash code of a Dart object. ```dart final instance = GoogleCloudDocumentaiV1Barcode(format: 'QR_CODE', value: 'example.com'); print(instance.hashCode); ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2Promotion-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1SummarizationVerbosityInstance Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Dart Class toString Example Source: https://pub.dev/documentation/googleapis/latest/documentai_v1/GoogleCloudDocumentaiV1ProcessOptionsIndividualPageSelector-class Demonstrates how to get a string representation of a Dart object. ```dart final instance = GoogleCloudDocumentaiV1Barcode(format: 'QR_CODE', value: 'example.com'); print(instance.toString()); ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1NotebookSoftwareConfig-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Get Person Details - Node.js Source: https://pub.dev/documentation/googleapis/latest/people_v1 Provides an example of fetching person details using the Google People API with the Node.js client library. The resource name and requested fields are specified in the get request. ```Node.js const { PeopleServiceClient } = require('@google-googleapis/people').v1; // Assuming 'peopleService' is an authenticated PeopleServiceClient const personResourceName = 'people/abcdef123456'; async function getPerson() { const [person] = await peopleService.people.get({ resourceName: personResourceName, personFields: 'names,emailAddresses', }); if (person.names && person.names.length > 0) { console.log(`Person's name: ${person.names[0].displayName}`); } if (person.emailAddresses && person.emailAddresses.length > 0) { console.log(`Person's email: ${person.emailAddresses[0].value}`); } } getPerson(); ``` -------------------------------- ### Start MFA Totp Enrollment Request Info (Dart) Source: https://pub.dev/documentation/googleapis/latest/identitytoolkit_v2/GoogleCloudIdentitytoolkitAdminV2MonitoringConfig-class Contains information required to start the MFA TOTP enrollment process in the Google Cloud Identity Toolkit V2 API. This is part of the multi-factor authentication setup. ```dart class GoogleCloudIdentitytoolkitV2StartMfaTotpEnrollmentRequestInfo { // ... properties and methods ... } ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2PinControlMetadataProductPins-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Access $GoogleCloudDocumentaiV1DocumentStyleFontSize Properties Source: https://pub.dev/documentation/googleapis/latest/shared/%24GoogleCloudDocumentaiV1DocumentStyleFontSize-class Provides examples of how to get and set the 'size' and 'unit' properties of a $GoogleCloudDocumentaiV1DocumentStyleFontSize object. ```dart // Get properties final double? size = fontSize.size; final String? unit = fontSize.unit; // Set properties fontSize.size = 14.0; fontSize.unit = 'em'; ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2UserInfo-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Dart toString Example Source: https://pub.dev/documentation/googleapis/latest/documentai_v1/GoogleCloudDocumentaiV1ListEvaluationsResponse-class Demonstrates how to get a string representation of a Document AI class instance using the toString method. ```dart print(processor.toString()); ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1SummarizationHelpfulnessInstance Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Dart toString Example Source: https://pub.dev/documentation/googleapis/latest/documentai_v1/GoogleCloudDocumentaiV1ProcessOptionsLayoutConfig-class Demonstrates how to get a string representation of a Google Cloud Document AI object using the toString method. ```dart import 'package:googleapis/documentai/v1.dart'; void main() { final status = GoogleRpcStatus( code: 0, message: 'OK', ); print(status.toString()); } ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1MetadataStore-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2Tile-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### ReportSummarySoleTenantNodeAllocation.node Property Source: https://pub.dev/documentation/googleapis/latest/migrationcenter_v1/ReportSummarySoleTenantNodeAllocation-class Gets or sets the Sole Tenant node type, for example, 'm3-node-128-3904'. This property is a getter/setter pair. ```dart node ↔ SoleTenantNodeType? ``` -------------------------------- ### Dart toString Example Source: https://pub.dev/documentation/googleapis/latest/documentai_v1/GoogleCloudDocumentaiV1DocumentChunkedDocumentChunk-class Demonstrates how to get a string representation of a Google Cloud Document AI object using the toString method in Dart. ```dart import 'package:googleapis/documentai/v1.dart'; void main() { final location = GoogleCloudLocationLocation(name: 'projects/my-project/locations/us-central1'); print(location.toString()); } ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2ProductInlineSource-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### FixedFrequencySchedule Property (startTime) Source: https://pub.dev/documentation/googleapis/latest/redis_v1/FixedFrequencySchedule-class Gets or sets the start time for all automated backups. The time is represented as a TimeOfDay object and is expected in UTC. ```dart startTime ↔ TimeOfDay? ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1SummarizationHelpfulnessInput-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/ProjectsResource-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### ProjectsLocationsInstancesResource Methods Source: https://pub.dev/documentation/googleapis/latest/notebooks_v2/ProjectsLocationsInstancesResource-class Details the methods for managing notebook instances, such as checkUpgradability, create, delete, get, list, patch, start, stop, and upgrade. ```dart checkUpgradability(String notebookInstance, {String? $fields}) → Future create(Instance request, String parent, {String? instanceId, String? requestId, String? $fields}) → Future delete(String name, {String? requestId, String? $fields}) → Future diagnose(DiagnoseInstanceRequest request, String name, {String? $fields}) → Future get(String name, {String? $fields}) → Future getConfig(String name, {String? $fields}) → Future getIamPolicy(String resource, {int? options_requestedPolicyVersion, String? $fields}) → Future list(String parent, {String? filter, String? orderBy, int? pageSize, String? pageToken, String? $fields}) → Future noSuchMethod(Invocation invocation) → dynamic patch(Instance request, String name, {String? requestId, String? updateMask, String? $fields}) → Future reportInfoSystem(ReportInstanceInfoSystemRequest request, String name, {String? $fields}) → Future reset(ResetInstanceRequest request, String name, {String? $fields}) → Future resizeDisk(ResizeDiskRequest request, String notebookInstance, {String? $fields}) → Future restore(RestoreInstanceRequest request, String name, {String? $fields}) → Future rollback(RollbackInstanceRequest request, String name, {String? $fields}) → Future setIamPolicy(SetIamPolicyRequest request, String resource, {String? $fields}) → Future start(StartInstanceRequest request, String name, {String? $fields}) → Future stop(StopInstanceRequest request, String name, {String? $fields}) → Future testIamPermissions(TestIamPermissionsRequest request, String resource, {String? $fields}) → Future tostring() → String upgrade(UpgradeInstanceRequest request, String name, {String? $fields}) → Future upgradeSystem(UpgradeInstanceSystemRequest request, String name, {String? $fields}) → Future ``` -------------------------------- ### Instantiate GoogleCloudAiplatformV1PublisherModelCallToActionDeployDeployMetadata Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1PublisherModelCallToActionDeployDeployMetadata-class Demonstrates how to create an instance of the GoogleCloudAiplatformV1PublisherModelCallToActionDeployDeployMetadata class using its constructors. It shows initialization with optional labels and a sample request. ```dart // Using the named constructor var metadata1 = GoogleCloudAiplatformV1PublisherModelCallToActionDeployDeployMetadata.new(labels: {'env': 'production'}, sampleRequest: 'POST /deploy'); // Using the fromJson constructor (assuming json_ is a valid Map) // var metadata2 = GoogleCloudAiplatformV1PublisherModelCallToActionDeployDeployMetadata.fromJson(json_); ``` -------------------------------- ### Get Policy Options Example Source: https://pub.dev/documentation/googleapis/latest/dataproc_v1/PySparkBatch-class Demonstrates the `GetPolicyOptions` class, used to specify options when retrieving an IAM policy, such as the desired policy version. ```java GetPolicyOptions policyOptions = new GetPolicyOptions(); policyOptions.setRequestedPolicyVersion(1); ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1SummarizationVerbosityInput-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### ProjectsLocationsOperationsResource Methods Source: https://pub.dev/documentation/googleapis/latest/redis_v1/ProjectsLocationsOperationsResource-class Provides methods to manage long-running operations for Redis instances. Includes starting cancellation, deleting, getting the status, and listing operations. ```dart cancel(String name, {String? $fields}) → Future ``` ```dart delete(String name, {String? $fields}) → Future ``` ```dart get(String name, {String? $fields}) → Future ``` ```dart list(String name, {String? filter, int? pageSize, String? pageToken, String? $fields}) → Future ``` -------------------------------- ### EnterprisesDevicesOperationsResource Methods Source: https://pub.dev/documentation/googleapis/latest/androidmanagement_v1/EnterprisesDevicesOperationsResource-class Provides methods for managing long-running operations related to devices. Includes starting cancellation, getting operation status, and listing operations. ```Dart cancel(String name, {String? $fields}) → Future Starts asynchronous cancellation on a long-running operation. ``` ```Dart get(String name, {String? $fields}) → Future Gets the latest state of a long-running operation. ``` ```Dart list(String name, {String? filter, int? pageSize, String? pageToken, String? $fields}) → Future Lists operations that match the specified filter in the request. ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2ListProductsResponse-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### WeeklySchedule startTimes Property - Dart Source: https://pub.dev/documentation/googleapis/latest/alloydb_v1/WeeklySchedule-class Gets or sets the times during the day to start a backup. This property accepts a list of GoogleTypeTimeOfDay objects. ```Dart startTimes ↔ List? ``` -------------------------------- ### Google Cloud Retail API v2 UserEvent Examples Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleProtobufEmpty Shows how to create and manage User Events for the Google Cloud Retail API v2. This includes logging product views, add-to-carts, and purchases. ```Python from google.cloud import retail_v2 from google.protobuf import timestamp_pb2 import datetime # Example for UserEvent user_event = retail_v2.UserEvent( event_type="product-detail", user_info=retail_v2.UserInfo( user_id="user_456", user_pseudo_id="user_pseudo_id_789" ), product_details=[ retail_v2.ProductDetail( product=retail_v2.Product( name="products/product_id_2", id="product_id_2" ), quantity=1 ) ], event_time=timestamp_pb2.Timestamp( seconds=int(datetime.datetime.now().timestamp()) ), attribution_token="attribution_token_456", session_id="session_id_abc" ) print(user_event) ``` -------------------------------- ### Access $Color Properties Source: https://pub.dev/documentation/googleapis/latest/shared/%24Color-class Provides examples of how to get and set the individual color components (alpha, blue, green, red) of a $Color object. ```Dart final currentAlpha = myColor.alpha; myColor.red = 0.7; ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1GroundingChunk-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Get Dataplex Job Source: https://pub.dev/documentation/googleapis/latest/dataplex_v1/ProjectsLocationsLakesTasksJobsResource-class Provides an example of retrieving a specific job resource by its name. This method returns a Future containing the GoogleCloudDataplexV1Job object. ```Dart Future get(String name, {String? $fields}) ``` -------------------------------- ### Search Products - Java Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleCloudRetailV2SetDefaultBranchRequest-class Provides a Java example for searching products using the Google Cloud Retail API v2 client library. This involves setting up the client, defining the search request, and processing the results. ```Java import com.google.cloud.retail.v2.SearchRequest; import com.google.cloud.retail.v2.SearchResponse; import com.google.cloud.retail.v2.SearchServiceClient; import com.google.cloud.retail.v2.ServingConfigName; import java.io.IOException; public class SearchProducts { public static void searchProducts(String projectId, String servingConfigId, String query) throws IOException { try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { ServingConfigName servingConfigName = ServingConfigName.of(projectId, "default_catalog", servingConfigId); SearchRequest request = SearchRequest.newBuilder() .setPlacement(servingConfigName.toString()) .setQuery(query) .setPageSize(10) .setVariantIncludesAttributes(true) .build(); SearchResponse response = searchServiceClient.search(request); System.out.println("Search results:"); for (SearchResponse.SearchResult result : response.getResultsList()) { System.out.println(" Product: " + result.getProduct().getTitle()); System.out.println(" Price: " + result.getProduct().getPriceInfo().getPrice()); } } } // Example usage: // public static void main(String[] args) throws IOException { // searchProducts("your-project-id", "default_serving_config_id", "stylish blue shoes"); // } } ``` -------------------------------- ### Get Interconnect Attachment Configuration Constraints Source: https://pub.dev/documentation/googleapis/latest/compute_v1/InterconnectAttachment-class Retrieves the configuration constraints for the Interconnect Attachment, if any. These constraints define specific requirements for the attachment's setup. ```Python attachment.configurationConstraints ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1Tool-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### AI Platform V1 Examples and Restrictions Source: https://pub.dev/documentation/googleapis/latest/aiplatform_v1/GoogleCloudAiplatformV1FindNeighborsResponse-class Structures for defining example data sources, overrides, and restrictions for AI Platform features. ```Python from google.cloud.aiplatform_v1.types import examples # Example usage for Examples examples = examples.Examples( source=examples.Examples.ExampleGcsSource( gcs_source="gs://my-bucket/examples/data.jsonl" ) ) # Example usage for ExamplesOverride examples_override = examples.ExamplesOverride( skip_examples=True ) # Example usage for ExamplesRestrictionsNamespace restrictions_namespace = examples.ExamplesRestrictionsNamespace( namespace="my-namespace" ) ``` -------------------------------- ### Dart runtimeType Example Source: https://pub.dev/documentation/googleapis/latest/healthcare_v1/ValidationConfig-class Shows how to access the `runtimeType` property of an object to get its actual type at runtime. This is useful for type checking and introspection. ```dart class Vehicle {} class Car extends Vehicle {} void main() { final myCar = Car(); print(myCar.runtimeType); // Output: Car Vehicle myVehicle = Car(); print(myVehicle.runtimeType); // Output: Car } ``` -------------------------------- ### Google Cloud Retail API v2 Search Request Examples Source: https://pub.dev/documentation/googleapis/latest/retail_v2/GoogleProtobufEmpty Provides examples of how to construct search requests for the Google Cloud Retail API v2. This includes setting up query expansion, dynamic facets, and personalization specifications. ```Python from google.cloud import retail_v2 # Example for SearchRequest search_request = retail_v2.SearchRequest( placement="projects/PROJECT_ID/locations/LOCATION_ID/catalogs/default_catalog/placements/default_search", query="a_search_query", page_size=10, variant_excludes=["variant_id_1", "variant_id_2"], variant_includes=["variant_id_3"], user_info=retail_v2.UserInfo(user_id="user_123"), query_expansion_spec=retail_v2.SearchRequest.QueryExpansionSpec( condition=retail_v2.SearchRequest.QueryExpansionSpec.Condition.AUTO_EXPAND ), dynamic_facet_spec=retail_v2.SearchRequest.DynamicFacetSpec( mode=retail_v2.SearchRequest.DynamicFacetSpec.Mode.DYNAMIC_FACET_MODE_ENABLED ), personalization_spec=retail_v2.SearchRequest.PersonalizationSpec( mode=retail_v2.SearchRequest.PersonalizationSpec.Mode.PERSONALIZATION_MODE_ENABLED ), spell_correction_spec=retail_v2.SearchRequest.SpellCorrectionSpec( mode=retail_v2.SearchRequest.SpellCorrectionSpec.Mode.SUGGESTION_ONLY ), user_answer_selected_answer="selected_answer_id", filter="price > 100" ) print(search_request) ```