@@ -1550,6 +1550,255 @@ public final UnaryCallable<ExportModelRequest, Operation> exportModelCallable()
1550
1550
return stub .exportModelCallable ();
1551
1551
}
1552
1552
1553
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1554
+ /**
1555
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1556
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1557
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1558
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1559
+ *
1560
+ * <p>Sample code:
1561
+ *
1562
+ * <pre>{@code
1563
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1564
+ * // It will require modifications to work:
1565
+ * // - It may require correct/in-range values for request initialization.
1566
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1567
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1568
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1569
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
1570
+ * ModelName sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
1571
+ * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get();
1572
+ * }
1573
+ * }</pre>
1574
+ *
1575
+ * @param parent Required. The resource name of the Location into which to copy the Model. Format:
1576
+ * `projects/{project}/locations/{location}`
1577
+ * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the
1578
+ * same Project. Format: `projects/{project}/locations/{location}/models/{model}`
1579
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1580
+ */
1581
+ public final OperationFuture <CopyModelResponse , CopyModelOperationMetadata > copyModelAsync (
1582
+ LocationName parent , ModelName sourceModel ) {
1583
+ CopyModelRequest request =
1584
+ CopyModelRequest .newBuilder ()
1585
+ .setParent (parent == null ? null : parent .toString ())
1586
+ .setSourceModel (sourceModel == null ? null : sourceModel .toString ())
1587
+ .build ();
1588
+ return copyModelAsync (request );
1589
+ }
1590
+
1591
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1592
+ /**
1593
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1594
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1595
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1596
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1597
+ *
1598
+ * <p>Sample code:
1599
+ *
1600
+ * <pre>{@code
1601
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1602
+ * // It will require modifications to work:
1603
+ * // - It may require correct/in-range values for request initialization.
1604
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1605
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1606
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1607
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
1608
+ * String sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
1609
+ * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get();
1610
+ * }
1611
+ * }</pre>
1612
+ *
1613
+ * @param parent Required. The resource name of the Location into which to copy the Model. Format:
1614
+ * `projects/{project}/locations/{location}`
1615
+ * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the
1616
+ * same Project. Format: `projects/{project}/locations/{location}/models/{model}`
1617
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1618
+ */
1619
+ public final OperationFuture <CopyModelResponse , CopyModelOperationMetadata > copyModelAsync (
1620
+ LocationName parent , String sourceModel ) {
1621
+ CopyModelRequest request =
1622
+ CopyModelRequest .newBuilder ()
1623
+ .setParent (parent == null ? null : parent .toString ())
1624
+ .setSourceModel (sourceModel )
1625
+ .build ();
1626
+ return copyModelAsync (request );
1627
+ }
1628
+
1629
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1630
+ /**
1631
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1632
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1633
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1634
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1635
+ *
1636
+ * <p>Sample code:
1637
+ *
1638
+ * <pre>{@code
1639
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1640
+ * // It will require modifications to work:
1641
+ * // - It may require correct/in-range values for request initialization.
1642
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1643
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1644
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1645
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
1646
+ * ModelName sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
1647
+ * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get();
1648
+ * }
1649
+ * }</pre>
1650
+ *
1651
+ * @param parent Required. The resource name of the Location into which to copy the Model. Format:
1652
+ * `projects/{project}/locations/{location}`
1653
+ * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the
1654
+ * same Project. Format: `projects/{project}/locations/{location}/models/{model}`
1655
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1656
+ */
1657
+ public final OperationFuture <CopyModelResponse , CopyModelOperationMetadata > copyModelAsync (
1658
+ String parent , ModelName sourceModel ) {
1659
+ CopyModelRequest request =
1660
+ CopyModelRequest .newBuilder ()
1661
+ .setParent (parent )
1662
+ .setSourceModel (sourceModel == null ? null : sourceModel .toString ())
1663
+ .build ();
1664
+ return copyModelAsync (request );
1665
+ }
1666
+
1667
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1668
+ /**
1669
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1670
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1671
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1672
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1673
+ *
1674
+ * <p>Sample code:
1675
+ *
1676
+ * <pre>{@code
1677
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1678
+ * // It will require modifications to work:
1679
+ * // - It may require correct/in-range values for request initialization.
1680
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1681
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1682
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1683
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
1684
+ * String sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
1685
+ * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get();
1686
+ * }
1687
+ * }</pre>
1688
+ *
1689
+ * @param parent Required. The resource name of the Location into which to copy the Model. Format:
1690
+ * `projects/{project}/locations/{location}`
1691
+ * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the
1692
+ * same Project. Format: `projects/{project}/locations/{location}/models/{model}`
1693
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1694
+ */
1695
+ public final OperationFuture <CopyModelResponse , CopyModelOperationMetadata > copyModelAsync (
1696
+ String parent , String sourceModel ) {
1697
+ CopyModelRequest request =
1698
+ CopyModelRequest .newBuilder ().setParent (parent ).setSourceModel (sourceModel ).build ();
1699
+ return copyModelAsync (request );
1700
+ }
1701
+
1702
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1703
+ /**
1704
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1705
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1706
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1707
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1708
+ *
1709
+ * <p>Sample code:
1710
+ *
1711
+ * <pre>{@code
1712
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1713
+ * // It will require modifications to work:
1714
+ * // - It may require correct/in-range values for request initialization.
1715
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1716
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1717
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1718
+ * CopyModelRequest request =
1719
+ * CopyModelRequest.newBuilder()
1720
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1721
+ * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
1722
+ * .setEncryptionSpec(EncryptionSpec.newBuilder().build())
1723
+ * .build();
1724
+ * CopyModelResponse response = modelServiceClient.copyModelAsync(request).get();
1725
+ * }
1726
+ * }</pre>
1727
+ *
1728
+ * @param request The request object containing all of the parameters for the API call.
1729
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1730
+ */
1731
+ public final OperationFuture <CopyModelResponse , CopyModelOperationMetadata > copyModelAsync (
1732
+ CopyModelRequest request ) {
1733
+ return copyModelOperationCallable ().futureCall (request );
1734
+ }
1735
+
1736
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1737
+ /**
1738
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1739
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1740
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1741
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1742
+ *
1743
+ * <p>Sample code:
1744
+ *
1745
+ * <pre>{@code
1746
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1747
+ * // It will require modifications to work:
1748
+ * // - It may require correct/in-range values for request initialization.
1749
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1750
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1751
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1752
+ * CopyModelRequest request =
1753
+ * CopyModelRequest.newBuilder()
1754
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1755
+ * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
1756
+ * .setEncryptionSpec(EncryptionSpec.newBuilder().build())
1757
+ * .build();
1758
+ * OperationFuture<CopyModelResponse, CopyModelOperationMetadata> future =
1759
+ * modelServiceClient.copyModelOperationCallable().futureCall(request);
1760
+ * // Do something.
1761
+ * CopyModelResponse response = future.get();
1762
+ * }
1763
+ * }</pre>
1764
+ */
1765
+ public final OperationCallable <CopyModelRequest , CopyModelResponse , CopyModelOperationMetadata >
1766
+ copyModelOperationCallable () {
1767
+ return stub .copyModelOperationCallable ();
1768
+ }
1769
+
1770
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
1771
+ /**
1772
+ * Copies an already existing Vertex AI Model into the specified Location. The source Model must
1773
+ * exist in the same Project. When copying custom Models, the users themselves are responsible for
1774
+ * [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be region-agnostic, as
1775
+ * well as making sure that any resources (e.g. files) it depends on remain accessible.
1776
+ *
1777
+ * <p>Sample code:
1778
+ *
1779
+ * <pre>{@code
1780
+ * // This snippet has been automatically generated and should be regarded as a code template only.
1781
+ * // It will require modifications to work:
1782
+ * // - It may require correct/in-range values for request initialization.
1783
+ * // - It may require specifying regional endpoints when creating the service client as shown in
1784
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1785
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1786
+ * CopyModelRequest request =
1787
+ * CopyModelRequest.newBuilder()
1788
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1789
+ * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
1790
+ * .setEncryptionSpec(EncryptionSpec.newBuilder().build())
1791
+ * .build();
1792
+ * ApiFuture<Operation> future = modelServiceClient.copyModelCallable().futureCall(request);
1793
+ * // Do something.
1794
+ * Operation response = future.get();
1795
+ * }
1796
+ * }</pre>
1797
+ */
1798
+ public final UnaryCallable <CopyModelRequest , Operation > copyModelCallable () {
1799
+ return stub .copyModelCallable ();
1800
+ }
1801
+
1553
1802
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1554
1803
/**
1555
1804
* Imports an externally generated ModelEvaluation.
0 commit comments