google-cloud-firestore-admin-v1 0.14.3 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1539,6 +1539,774 @@ module Google
1539
1539
  raise ::Google::Cloud::Error.from_error(e)
1540
1540
  end
1541
1541
 
1542
+ ##
1543
+ # Gets information about a backup.
1544
+ #
1545
+ # @overload get_backup(request, options = nil)
1546
+ # Pass arguments to `get_backup` via a request object, either of type
1547
+ # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash.
1548
+ #
1549
+ # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::Hash]
1550
+ # A request object representing the call parameters. Required. To specify no
1551
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1552
+ # @param options [::Gapic::CallOptions, ::Hash]
1553
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1554
+ #
1555
+ # @overload get_backup(name: nil)
1556
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1557
+ # least one keyword argument is required. To specify no parameters, or to keep all
1558
+ # the default parameter values, pass an empty Hash as a request object (see above).
1559
+ #
1560
+ # @param name [::String]
1561
+ # Required. Name of the backup to fetch.
1562
+ #
1563
+ # Format is `projects/{project}/locations/{location}/backups/{backup}`.
1564
+ # @yield [result, operation] Access the result along with the TransportOperation object
1565
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Backup]
1566
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1567
+ #
1568
+ # @return [::Google::Cloud::Firestore::Admin::V1::Backup]
1569
+ #
1570
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1571
+ #
1572
+ # @example Basic example
1573
+ # require "google/cloud/firestore/admin/v1"
1574
+ #
1575
+ # # Create a client object. The client can be reused for multiple calls.
1576
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1577
+ #
1578
+ # # Create a request. To set request fields, pass in keyword arguments.
1579
+ # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new
1580
+ #
1581
+ # # Call the get_backup method.
1582
+ # result = client.get_backup request
1583
+ #
1584
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup.
1585
+ # p result
1586
+ #
1587
+ def get_backup request, options = nil
1588
+ raise ::ArgumentError, "request must be provided" if request.nil?
1589
+
1590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest
1591
+
1592
+ # Converts hash and nil to an options object
1593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1594
+
1595
+ # Customize the options with defaults
1596
+ call_metadata = @config.rpcs.get_backup.metadata.to_h
1597
+
1598
+ # Set x-goog-api-client and x-goog-user-project headers
1599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1601
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1602
+ transports_version_send: [:rest]
1603
+
1604
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1605
+
1606
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1607
+ metadata: call_metadata,
1608
+ retry_policy: @config.rpcs.get_backup.retry_policy
1609
+
1610
+ options.apply_defaults timeout: @config.timeout,
1611
+ metadata: @config.metadata,
1612
+ retry_policy: @config.retry_policy
1613
+
1614
+ @firestore_admin_stub.get_backup request, options do |result, operation|
1615
+ yield result, operation if block_given?
1616
+ return result
1617
+ end
1618
+ rescue ::Gapic::Rest::Error => e
1619
+ raise ::Google::Cloud::Error.from_error(e)
1620
+ end
1621
+
1622
+ ##
1623
+ # Lists all the backups.
1624
+ #
1625
+ # @overload list_backups(request, options = nil)
1626
+ # Pass arguments to `list_backups` via a request object, either of type
1627
+ # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash.
1628
+ #
1629
+ # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::Hash]
1630
+ # A request object representing the call parameters. Required. To specify no
1631
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1632
+ # @param options [::Gapic::CallOptions, ::Hash]
1633
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1634
+ #
1635
+ # @overload list_backups(parent: nil)
1636
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1637
+ # least one keyword argument is required. To specify no parameters, or to keep all
1638
+ # the default parameter values, pass an empty Hash as a request object (see above).
1639
+ #
1640
+ # @param parent [::String]
1641
+ # Required. The location to list backups from.
1642
+ #
1643
+ # Format is `projects/{project}/locations/{location}`.
1644
+ # Use `{location} = '-'` to list backups from all locations for the given
1645
+ # project. This allows listing backups from a single location or from all
1646
+ # locations.
1647
+ # @yield [result, operation] Access the result along with the TransportOperation object
1648
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse]
1649
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1650
+ #
1651
+ # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse]
1652
+ #
1653
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1654
+ #
1655
+ # @example Basic example
1656
+ # require "google/cloud/firestore/admin/v1"
1657
+ #
1658
+ # # Create a client object. The client can be reused for multiple calls.
1659
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1660
+ #
1661
+ # # Create a request. To set request fields, pass in keyword arguments.
1662
+ # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new
1663
+ #
1664
+ # # Call the list_backups method.
1665
+ # result = client.list_backups request
1666
+ #
1667
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.
1668
+ # p result
1669
+ #
1670
+ def list_backups request, options = nil
1671
+ raise ::ArgumentError, "request must be provided" if request.nil?
1672
+
1673
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest
1674
+
1675
+ # Converts hash and nil to an options object
1676
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1677
+
1678
+ # Customize the options with defaults
1679
+ call_metadata = @config.rpcs.list_backups.metadata.to_h
1680
+
1681
+ # Set x-goog-api-client and x-goog-user-project headers
1682
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1683
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1684
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1685
+ transports_version_send: [:rest]
1686
+
1687
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1688
+
1689
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1690
+ metadata: call_metadata,
1691
+ retry_policy: @config.rpcs.list_backups.retry_policy
1692
+
1693
+ options.apply_defaults timeout: @config.timeout,
1694
+ metadata: @config.metadata,
1695
+ retry_policy: @config.retry_policy
1696
+
1697
+ @firestore_admin_stub.list_backups request, options do |result, operation|
1698
+ yield result, operation if block_given?
1699
+ return result
1700
+ end
1701
+ rescue ::Gapic::Rest::Error => e
1702
+ raise ::Google::Cloud::Error.from_error(e)
1703
+ end
1704
+
1705
+ ##
1706
+ # Deletes a backup.
1707
+ #
1708
+ # @overload delete_backup(request, options = nil)
1709
+ # Pass arguments to `delete_backup` via a request object, either of type
1710
+ # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash.
1711
+ #
1712
+ # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::Hash]
1713
+ # A request object representing the call parameters. Required. To specify no
1714
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1715
+ # @param options [::Gapic::CallOptions, ::Hash]
1716
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1717
+ #
1718
+ # @overload delete_backup(name: nil)
1719
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1720
+ # least one keyword argument is required. To specify no parameters, or to keep all
1721
+ # the default parameter values, pass an empty Hash as a request object (see above).
1722
+ #
1723
+ # @param name [::String]
1724
+ # Required. Name of the backup to delete.
1725
+ #
1726
+ # format is `projects/{project}/locations/{location}/backups/{backup}`.
1727
+ # @yield [result, operation] Access the result along with the TransportOperation object
1728
+ # @yieldparam result [::Google::Protobuf::Empty]
1729
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1730
+ #
1731
+ # @return [::Google::Protobuf::Empty]
1732
+ #
1733
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1734
+ #
1735
+ # @example Basic example
1736
+ # require "google/cloud/firestore/admin/v1"
1737
+ #
1738
+ # # Create a client object. The client can be reused for multiple calls.
1739
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1740
+ #
1741
+ # # Create a request. To set request fields, pass in keyword arguments.
1742
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new
1743
+ #
1744
+ # # Call the delete_backup method.
1745
+ # result = client.delete_backup request
1746
+ #
1747
+ # # The returned object is of type Google::Protobuf::Empty.
1748
+ # p result
1749
+ #
1750
+ def delete_backup request, options = nil
1751
+ raise ::ArgumentError, "request must be provided" if request.nil?
1752
+
1753
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest
1754
+
1755
+ # Converts hash and nil to an options object
1756
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1757
+
1758
+ # Customize the options with defaults
1759
+ call_metadata = @config.rpcs.delete_backup.metadata.to_h
1760
+
1761
+ # Set x-goog-api-client and x-goog-user-project headers
1762
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1763
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1764
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1765
+ transports_version_send: [:rest]
1766
+
1767
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1768
+
1769
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1770
+ metadata: call_metadata,
1771
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1772
+
1773
+ options.apply_defaults timeout: @config.timeout,
1774
+ metadata: @config.metadata,
1775
+ retry_policy: @config.retry_policy
1776
+
1777
+ @firestore_admin_stub.delete_backup request, options do |result, operation|
1778
+ yield result, operation if block_given?
1779
+ return result
1780
+ end
1781
+ rescue ::Gapic::Rest::Error => e
1782
+ raise ::Google::Cloud::Error.from_error(e)
1783
+ end
1784
+
1785
+ ##
1786
+ # Creates a new database by restoring from an existing backup.
1787
+ #
1788
+ # The new database must be in the same cloud region or multi-region location
1789
+ # as the existing backup. This behaves similar to
1790
+ # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
1791
+ # except instead of creating a new empty database, a new database is created
1792
+ # with the database type, index configuration, and documents from an existing
1793
+ # backup.
1794
+ #
1795
+ # The {::Google::Longrunning::Operation long-running operation} can be used to
1796
+ # track the progress of the restore, with the Operation's
1797
+ # {::Google::Longrunning::Operation#metadata metadata} field type being the
1798
+ # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}.
1799
+ # The {::Google::Longrunning::Operation#response response} type is the
1800
+ # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was
1801
+ # successful. The new database is not readable or writeable until the LRO has
1802
+ # completed.
1803
+ #
1804
+ # @overload restore_database(request, options = nil)
1805
+ # Pass arguments to `restore_database` via a request object, either of type
1806
+ # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash.
1807
+ #
1808
+ # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::Hash]
1809
+ # A request object representing the call parameters. Required. To specify no
1810
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1811
+ # @param options [::Gapic::CallOptions, ::Hash]
1812
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1813
+ #
1814
+ # @overload restore_database(parent: nil, database_id: nil, backup: nil)
1815
+ # Pass arguments to `restore_database` via keyword arguments. Note that at
1816
+ # least one keyword argument is required. To specify no parameters, or to keep all
1817
+ # the default parameter values, pass an empty Hash as a request object (see above).
1818
+ #
1819
+ # @param parent [::String]
1820
+ # Required. The project to restore the database in. Format is
1821
+ # `projects/{project_id}`.
1822
+ # @param database_id [::String]
1823
+ # Required. The ID to use for the database, which will become the final
1824
+ # component of the database's resource name. This database id must not be
1825
+ # associated with an existing database.
1826
+ #
1827
+ # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
1828
+ # with first character a letter and the last a letter or a number. Must not
1829
+ # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
1830
+ #
1831
+ # "(default)" database id is also valid.
1832
+ # @param backup [::String]
1833
+ # Required. Backup to restore from. Must be from the same project as the
1834
+ # parent.
1835
+ #
1836
+ # Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
1837
+ # @yield [result, operation] Access the result along with the TransportOperation object
1838
+ # @yieldparam result [::Gapic::Operation]
1839
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1840
+ #
1841
+ # @return [::Gapic::Operation]
1842
+ #
1843
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1844
+ #
1845
+ # @example Basic example
1846
+ # require "google/cloud/firestore/admin/v1"
1847
+ #
1848
+ # # Create a client object. The client can be reused for multiple calls.
1849
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1850
+ #
1851
+ # # Create a request. To set request fields, pass in keyword arguments.
1852
+ # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new
1853
+ #
1854
+ # # Call the restore_database method.
1855
+ # result = client.restore_database request
1856
+ #
1857
+ # # The returned object is of type Gapic::Operation. You can use it to
1858
+ # # check the status of an operation, cancel it, or wait for results.
1859
+ # # Here is how to wait for a response.
1860
+ # result.wait_until_done! timeout: 60
1861
+ # if result.response?
1862
+ # p result.response
1863
+ # else
1864
+ # puts "No response received."
1865
+ # end
1866
+ #
1867
+ def restore_database request, options = nil
1868
+ raise ::ArgumentError, "request must be provided" if request.nil?
1869
+
1870
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest
1871
+
1872
+ # Converts hash and nil to an options object
1873
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1874
+
1875
+ # Customize the options with defaults
1876
+ call_metadata = @config.rpcs.restore_database.metadata.to_h
1877
+
1878
+ # Set x-goog-api-client and x-goog-user-project headers
1879
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1880
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1881
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1882
+ transports_version_send: [:rest]
1883
+
1884
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1885
+
1886
+ options.apply_defaults timeout: @config.rpcs.restore_database.timeout,
1887
+ metadata: call_metadata,
1888
+ retry_policy: @config.rpcs.restore_database.retry_policy
1889
+
1890
+ options.apply_defaults timeout: @config.timeout,
1891
+ metadata: @config.metadata,
1892
+ retry_policy: @config.retry_policy
1893
+
1894
+ @firestore_admin_stub.restore_database request, options do |result, operation|
1895
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1896
+ yield result, operation if block_given?
1897
+ return result
1898
+ end
1899
+ rescue ::Gapic::Rest::Error => e
1900
+ raise ::Google::Cloud::Error.from_error(e)
1901
+ end
1902
+
1903
+ ##
1904
+ # Creates a backup schedule on a database.
1905
+ # At most two backup schedules can be configured on a database, one daily
1906
+ # backup schedule with retention up to 7 days and one weekly backup schedule
1907
+ # with retention up to 14 weeks.
1908
+ #
1909
+ # @overload create_backup_schedule(request, options = nil)
1910
+ # Pass arguments to `create_backup_schedule` via a request object, either of type
1911
+ # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash.
1912
+ #
1913
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::Hash]
1914
+ # A request object representing the call parameters. Required. To specify no
1915
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1916
+ # @param options [::Gapic::CallOptions, ::Hash]
1917
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1918
+ #
1919
+ # @overload create_backup_schedule(parent: nil, backup_schedule: nil)
1920
+ # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at
1921
+ # least one keyword argument is required. To specify no parameters, or to keep all
1922
+ # the default parameter values, pass an empty Hash as a request object (see above).
1923
+ #
1924
+ # @param parent [::String]
1925
+ # Required. The parent database.
1926
+ #
1927
+ # Format `projects/{project}/databases/{database}`
1928
+ # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash]
1929
+ # Required. The backup schedule to create.
1930
+ # @yield [result, operation] Access the result along with the TransportOperation object
1931
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
1932
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1933
+ #
1934
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
1935
+ #
1936
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1937
+ #
1938
+ # @example Basic example
1939
+ # require "google/cloud/firestore/admin/v1"
1940
+ #
1941
+ # # Create a client object. The client can be reused for multiple calls.
1942
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1943
+ #
1944
+ # # Create a request. To set request fields, pass in keyword arguments.
1945
+ # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new
1946
+ #
1947
+ # # Call the create_backup_schedule method.
1948
+ # result = client.create_backup_schedule request
1949
+ #
1950
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
1951
+ # p result
1952
+ #
1953
+ def create_backup_schedule request, options = nil
1954
+ raise ::ArgumentError, "request must be provided" if request.nil?
1955
+
1956
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest
1957
+
1958
+ # Converts hash and nil to an options object
1959
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1960
+
1961
+ # Customize the options with defaults
1962
+ call_metadata = @config.rpcs.create_backup_schedule.metadata.to_h
1963
+
1964
+ # Set x-goog-api-client and x-goog-user-project headers
1965
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1966
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1967
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1968
+ transports_version_send: [:rest]
1969
+
1970
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1971
+
1972
+ options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout,
1973
+ metadata: call_metadata,
1974
+ retry_policy: @config.rpcs.create_backup_schedule.retry_policy
1975
+
1976
+ options.apply_defaults timeout: @config.timeout,
1977
+ metadata: @config.metadata,
1978
+ retry_policy: @config.retry_policy
1979
+
1980
+ @firestore_admin_stub.create_backup_schedule request, options do |result, operation|
1981
+ yield result, operation if block_given?
1982
+ return result
1983
+ end
1984
+ rescue ::Gapic::Rest::Error => e
1985
+ raise ::Google::Cloud::Error.from_error(e)
1986
+ end
1987
+
1988
+ ##
1989
+ # Gets information about a backup schedule.
1990
+ #
1991
+ # @overload get_backup_schedule(request, options = nil)
1992
+ # Pass arguments to `get_backup_schedule` via a request object, either of type
1993
+ # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash.
1994
+ #
1995
+ # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::Hash]
1996
+ # A request object representing the call parameters. Required. To specify no
1997
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1998
+ # @param options [::Gapic::CallOptions, ::Hash]
1999
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2000
+ #
2001
+ # @overload get_backup_schedule(name: nil)
2002
+ # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at
2003
+ # least one keyword argument is required. To specify no parameters, or to keep all
2004
+ # the default parameter values, pass an empty Hash as a request object (see above).
2005
+ #
2006
+ # @param name [::String]
2007
+ # Required. The name of the backup schedule.
2008
+ #
2009
+ # Format
2010
+ # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
2011
+ # @yield [result, operation] Access the result along with the TransportOperation object
2012
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2013
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2014
+ #
2015
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2016
+ #
2017
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2018
+ #
2019
+ # @example Basic example
2020
+ # require "google/cloud/firestore/admin/v1"
2021
+ #
2022
+ # # Create a client object. The client can be reused for multiple calls.
2023
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
2024
+ #
2025
+ # # Create a request. To set request fields, pass in keyword arguments.
2026
+ # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new
2027
+ #
2028
+ # # Call the get_backup_schedule method.
2029
+ # result = client.get_backup_schedule request
2030
+ #
2031
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
2032
+ # p result
2033
+ #
2034
+ def get_backup_schedule request, options = nil
2035
+ raise ::ArgumentError, "request must be provided" if request.nil?
2036
+
2037
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest
2038
+
2039
+ # Converts hash and nil to an options object
2040
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2041
+
2042
+ # Customize the options with defaults
2043
+ call_metadata = @config.rpcs.get_backup_schedule.metadata.to_h
2044
+
2045
+ # Set x-goog-api-client and x-goog-user-project headers
2046
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2047
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2048
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
2049
+ transports_version_send: [:rest]
2050
+
2051
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2052
+
2053
+ options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout,
2054
+ metadata: call_metadata,
2055
+ retry_policy: @config.rpcs.get_backup_schedule.retry_policy
2056
+
2057
+ options.apply_defaults timeout: @config.timeout,
2058
+ metadata: @config.metadata,
2059
+ retry_policy: @config.retry_policy
2060
+
2061
+ @firestore_admin_stub.get_backup_schedule request, options do |result, operation|
2062
+ yield result, operation if block_given?
2063
+ return result
2064
+ end
2065
+ rescue ::Gapic::Rest::Error => e
2066
+ raise ::Google::Cloud::Error.from_error(e)
2067
+ end
2068
+
2069
+ ##
2070
+ # List backup schedules.
2071
+ #
2072
+ # @overload list_backup_schedules(request, options = nil)
2073
+ # Pass arguments to `list_backup_schedules` via a request object, either of type
2074
+ # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash.
2075
+ #
2076
+ # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::Hash]
2077
+ # A request object representing the call parameters. Required. To specify no
2078
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2079
+ # @param options [::Gapic::CallOptions, ::Hash]
2080
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2081
+ #
2082
+ # @overload list_backup_schedules(parent: nil)
2083
+ # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at
2084
+ # least one keyword argument is required. To specify no parameters, or to keep all
2085
+ # the default parameter values, pass an empty Hash as a request object (see above).
2086
+ #
2087
+ # @param parent [::String]
2088
+ # Required. The parent database.
2089
+ #
2090
+ # Format is `projects/{project}/databases/{database}`.
2091
+ # @yield [result, operation] Access the result along with the TransportOperation object
2092
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse]
2093
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2094
+ #
2095
+ # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse]
2096
+ #
2097
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2098
+ #
2099
+ # @example Basic example
2100
+ # require "google/cloud/firestore/admin/v1"
2101
+ #
2102
+ # # Create a client object. The client can be reused for multiple calls.
2103
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
2104
+ #
2105
+ # # Create a request. To set request fields, pass in keyword arguments.
2106
+ # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new
2107
+ #
2108
+ # # Call the list_backup_schedules method.
2109
+ # result = client.list_backup_schedules request
2110
+ #
2111
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.
2112
+ # p result
2113
+ #
2114
+ def list_backup_schedules request, options = nil
2115
+ raise ::ArgumentError, "request must be provided" if request.nil?
2116
+
2117
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest
2118
+
2119
+ # Converts hash and nil to an options object
2120
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2121
+
2122
+ # Customize the options with defaults
2123
+ call_metadata = @config.rpcs.list_backup_schedules.metadata.to_h
2124
+
2125
+ # Set x-goog-api-client and x-goog-user-project headers
2126
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2127
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2128
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
2129
+ transports_version_send: [:rest]
2130
+
2131
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2132
+
2133
+ options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout,
2134
+ metadata: call_metadata,
2135
+ retry_policy: @config.rpcs.list_backup_schedules.retry_policy
2136
+
2137
+ options.apply_defaults timeout: @config.timeout,
2138
+ metadata: @config.metadata,
2139
+ retry_policy: @config.retry_policy
2140
+
2141
+ @firestore_admin_stub.list_backup_schedules request, options do |result, operation|
2142
+ yield result, operation if block_given?
2143
+ return result
2144
+ end
2145
+ rescue ::Gapic::Rest::Error => e
2146
+ raise ::Google::Cloud::Error.from_error(e)
2147
+ end
2148
+
2149
+ ##
2150
+ # Updates a backup schedule.
2151
+ #
2152
+ # @overload update_backup_schedule(request, options = nil)
2153
+ # Pass arguments to `update_backup_schedule` via a request object, either of type
2154
+ # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash.
2155
+ #
2156
+ # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::Hash]
2157
+ # A request object representing the call parameters. Required. To specify no
2158
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2159
+ # @param options [::Gapic::CallOptions, ::Hash]
2160
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2161
+ #
2162
+ # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil)
2163
+ # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at
2164
+ # least one keyword argument is required. To specify no parameters, or to keep all
2165
+ # the default parameter values, pass an empty Hash as a request object (see above).
2166
+ #
2167
+ # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash]
2168
+ # Required. The backup schedule to update.
2169
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2170
+ # The list of fields to be updated.
2171
+ # @yield [result, operation] Access the result along with the TransportOperation object
2172
+ # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2173
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2174
+ #
2175
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2176
+ #
2177
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2178
+ #
2179
+ # @example Basic example
2180
+ # require "google/cloud/firestore/admin/v1"
2181
+ #
2182
+ # # Create a client object. The client can be reused for multiple calls.
2183
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
2184
+ #
2185
+ # # Create a request. To set request fields, pass in keyword arguments.
2186
+ # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new
2187
+ #
2188
+ # # Call the update_backup_schedule method.
2189
+ # result = client.update_backup_schedule request
2190
+ #
2191
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
2192
+ # p result
2193
+ #
2194
+ def update_backup_schedule request, options = nil
2195
+ raise ::ArgumentError, "request must be provided" if request.nil?
2196
+
2197
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest
2198
+
2199
+ # Converts hash and nil to an options object
2200
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2201
+
2202
+ # Customize the options with defaults
2203
+ call_metadata = @config.rpcs.update_backup_schedule.metadata.to_h
2204
+
2205
+ # Set x-goog-api-client and x-goog-user-project headers
2206
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2207
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2208
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
2209
+ transports_version_send: [:rest]
2210
+
2211
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2212
+
2213
+ options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout,
2214
+ metadata: call_metadata,
2215
+ retry_policy: @config.rpcs.update_backup_schedule.retry_policy
2216
+
2217
+ options.apply_defaults timeout: @config.timeout,
2218
+ metadata: @config.metadata,
2219
+ retry_policy: @config.retry_policy
2220
+
2221
+ @firestore_admin_stub.update_backup_schedule request, options do |result, operation|
2222
+ yield result, operation if block_given?
2223
+ return result
2224
+ end
2225
+ rescue ::Gapic::Rest::Error => e
2226
+ raise ::Google::Cloud::Error.from_error(e)
2227
+ end
2228
+
2229
+ ##
2230
+ # Deletes a backup schedule.
2231
+ #
2232
+ # @overload delete_backup_schedule(request, options = nil)
2233
+ # Pass arguments to `delete_backup_schedule` via a request object, either of type
2234
+ # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash.
2235
+ #
2236
+ # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::Hash]
2237
+ # A request object representing the call parameters. Required. To specify no
2238
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2239
+ # @param options [::Gapic::CallOptions, ::Hash]
2240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2241
+ #
2242
+ # @overload delete_backup_schedule(name: nil)
2243
+ # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at
2244
+ # least one keyword argument is required. To specify no parameters, or to keep all
2245
+ # the default parameter values, pass an empty Hash as a request object (see above).
2246
+ #
2247
+ # @param name [::String]
2248
+ # Required. The name of backup schedule.
2249
+ #
2250
+ # Format
2251
+ # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
2252
+ # @yield [result, operation] Access the result along with the TransportOperation object
2253
+ # @yieldparam result [::Google::Protobuf::Empty]
2254
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2255
+ #
2256
+ # @return [::Google::Protobuf::Empty]
2257
+ #
2258
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2259
+ #
2260
+ # @example Basic example
2261
+ # require "google/cloud/firestore/admin/v1"
2262
+ #
2263
+ # # Create a client object. The client can be reused for multiple calls.
2264
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
2265
+ #
2266
+ # # Create a request. To set request fields, pass in keyword arguments.
2267
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new
2268
+ #
2269
+ # # Call the delete_backup_schedule method.
2270
+ # result = client.delete_backup_schedule request
2271
+ #
2272
+ # # The returned object is of type Google::Protobuf::Empty.
2273
+ # p result
2274
+ #
2275
+ def delete_backup_schedule request, options = nil
2276
+ raise ::ArgumentError, "request must be provided" if request.nil?
2277
+
2278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest
2279
+
2280
+ # Converts hash and nil to an options object
2281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2282
+
2283
+ # Customize the options with defaults
2284
+ call_metadata = @config.rpcs.delete_backup_schedule.metadata.to_h
2285
+
2286
+ # Set x-goog-api-client and x-goog-user-project headers
2287
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2289
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
2290
+ transports_version_send: [:rest]
2291
+
2292
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2293
+
2294
+ options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout,
2295
+ metadata: call_metadata,
2296
+ retry_policy: @config.rpcs.delete_backup_schedule.retry_policy
2297
+
2298
+ options.apply_defaults timeout: @config.timeout,
2299
+ metadata: @config.metadata,
2300
+ retry_policy: @config.retry_policy
2301
+
2302
+ @firestore_admin_stub.delete_backup_schedule request, options do |result, operation|
2303
+ yield result, operation if block_given?
2304
+ return result
2305
+ end
2306
+ rescue ::Gapic::Rest::Error => e
2307
+ raise ::Google::Cloud::Error.from_error(e)
2308
+ end
2309
+
1542
2310
  ##
1543
2311
  # Configuration class for the FirestoreAdmin REST API.
1544
2312
  #
@@ -1742,6 +2510,51 @@ module Google
1742
2510
  # @return [::Gapic::Config::Method]
1743
2511
  #
1744
2512
  attr_reader :delete_database
2513
+ ##
2514
+ # RPC-specific configuration for `get_backup`
2515
+ # @return [::Gapic::Config::Method]
2516
+ #
2517
+ attr_reader :get_backup
2518
+ ##
2519
+ # RPC-specific configuration for `list_backups`
2520
+ # @return [::Gapic::Config::Method]
2521
+ #
2522
+ attr_reader :list_backups
2523
+ ##
2524
+ # RPC-specific configuration for `delete_backup`
2525
+ # @return [::Gapic::Config::Method]
2526
+ #
2527
+ attr_reader :delete_backup
2528
+ ##
2529
+ # RPC-specific configuration for `restore_database`
2530
+ # @return [::Gapic::Config::Method]
2531
+ #
2532
+ attr_reader :restore_database
2533
+ ##
2534
+ # RPC-specific configuration for `create_backup_schedule`
2535
+ # @return [::Gapic::Config::Method]
2536
+ #
2537
+ attr_reader :create_backup_schedule
2538
+ ##
2539
+ # RPC-specific configuration for `get_backup_schedule`
2540
+ # @return [::Gapic::Config::Method]
2541
+ #
2542
+ attr_reader :get_backup_schedule
2543
+ ##
2544
+ # RPC-specific configuration for `list_backup_schedules`
2545
+ # @return [::Gapic::Config::Method]
2546
+ #
2547
+ attr_reader :list_backup_schedules
2548
+ ##
2549
+ # RPC-specific configuration for `update_backup_schedule`
2550
+ # @return [::Gapic::Config::Method]
2551
+ #
2552
+ attr_reader :update_backup_schedule
2553
+ ##
2554
+ # RPC-specific configuration for `delete_backup_schedule`
2555
+ # @return [::Gapic::Config::Method]
2556
+ #
2557
+ attr_reader :delete_backup_schedule
1745
2558
 
1746
2559
  # @private
1747
2560
  def initialize parent_rpcs = nil
@@ -1773,6 +2586,24 @@ module Google
1773
2586
  @update_database = ::Gapic::Config::Method.new update_database_config
1774
2587
  delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database
1775
2588
  @delete_database = ::Gapic::Config::Method.new delete_database_config
2589
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2590
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2591
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2592
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2593
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2594
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2595
+ restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database
2596
+ @restore_database = ::Gapic::Config::Method.new restore_database_config
2597
+ create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule
2598
+ @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config
2599
+ get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule
2600
+ @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config
2601
+ list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules
2602
+ @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config
2603
+ update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule
2604
+ @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
2605
+ delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
2606
+ @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
1776
2607
 
1777
2608
  yield self if block_given?
1778
2609
  end