google-cloud-firestore-admin-v1 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1644,6 +1644,837 @@ module Google
1644
1644
  raise ::Google::Cloud::Error.from_error(e)
1645
1645
  end
1646
1646
 
1647
+ ##
1648
+ # Gets information about a backup.
1649
+ #
1650
+ # @overload get_backup(request, options = nil)
1651
+ # Pass arguments to `get_backup` via a request object, either of type
1652
+ # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash.
1653
+ #
1654
+ # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::Hash]
1655
+ # A request object representing the call parameters. Required. To specify no
1656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1657
+ # @param options [::Gapic::CallOptions, ::Hash]
1658
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1659
+ #
1660
+ # @overload get_backup(name: nil)
1661
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1662
+ # least one keyword argument is required. To specify no parameters, or to keep all
1663
+ # the default parameter values, pass an empty Hash as a request object (see above).
1664
+ #
1665
+ # @param name [::String]
1666
+ # Required. Name of the backup to fetch.
1667
+ #
1668
+ # Format is `projects/{project}/locations/{location}/backups/{backup}`.
1669
+ #
1670
+ # @yield [response, operation] Access the result along with the RPC operation
1671
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Backup]
1672
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1673
+ #
1674
+ # @return [::Google::Cloud::Firestore::Admin::V1::Backup]
1675
+ #
1676
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1677
+ #
1678
+ # @example Basic example
1679
+ # require "google/cloud/firestore/admin/v1"
1680
+ #
1681
+ # # Create a client object. The client can be reused for multiple calls.
1682
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1683
+ #
1684
+ # # Create a request. To set request fields, pass in keyword arguments.
1685
+ # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new
1686
+ #
1687
+ # # Call the get_backup method.
1688
+ # result = client.get_backup request
1689
+ #
1690
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup.
1691
+ # p result
1692
+ #
1693
+ def get_backup request, options = nil
1694
+ raise ::ArgumentError, "request must be provided" if request.nil?
1695
+
1696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest
1697
+
1698
+ # Converts hash and nil to an options object
1699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1700
+
1701
+ # Customize the options with defaults
1702
+ metadata = @config.rpcs.get_backup.metadata.to_h
1703
+
1704
+ # Set x-goog-api-client and x-goog-user-project headers
1705
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1706
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1707
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
1708
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1709
+
1710
+ header_params = {}
1711
+ if request.name
1712
+ header_params["name"] = request.name
1713
+ end
1714
+
1715
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1716
+ metadata[:"x-goog-request-params"] ||= request_params_header
1717
+
1718
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1719
+ metadata: metadata,
1720
+ retry_policy: @config.rpcs.get_backup.retry_policy
1721
+
1722
+ options.apply_defaults timeout: @config.timeout,
1723
+ metadata: @config.metadata,
1724
+ retry_policy: @config.retry_policy
1725
+
1726
+ @firestore_admin_stub.call_rpc :get_backup, request, options: options do |response, operation|
1727
+ yield response, operation if block_given?
1728
+ return response
1729
+ end
1730
+ rescue ::GRPC::BadStatus => e
1731
+ raise ::Google::Cloud::Error.from_error(e)
1732
+ end
1733
+
1734
+ ##
1735
+ # Lists all the backups.
1736
+ #
1737
+ # @overload list_backups(request, options = nil)
1738
+ # Pass arguments to `list_backups` via a request object, either of type
1739
+ # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash.
1740
+ #
1741
+ # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::Hash]
1742
+ # A request object representing the call parameters. Required. To specify no
1743
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1744
+ # @param options [::Gapic::CallOptions, ::Hash]
1745
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1746
+ #
1747
+ # @overload list_backups(parent: nil)
1748
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1749
+ # least one keyword argument is required. To specify no parameters, or to keep all
1750
+ # the default parameter values, pass an empty Hash as a request object (see above).
1751
+ #
1752
+ # @param parent [::String]
1753
+ # Required. The location to list backups from.
1754
+ #
1755
+ # Format is `projects/{project}/locations/{location}`.
1756
+ # Use `{location} = '-'` to list backups from all locations for the given
1757
+ # project. This allows listing backups from a single location or from all
1758
+ # locations.
1759
+ #
1760
+ # @yield [response, operation] Access the result along with the RPC operation
1761
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse]
1762
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1763
+ #
1764
+ # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse]
1765
+ #
1766
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1767
+ #
1768
+ # @example Basic example
1769
+ # require "google/cloud/firestore/admin/v1"
1770
+ #
1771
+ # # Create a client object. The client can be reused for multiple calls.
1772
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1773
+ #
1774
+ # # Create a request. To set request fields, pass in keyword arguments.
1775
+ # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new
1776
+ #
1777
+ # # Call the list_backups method.
1778
+ # result = client.list_backups request
1779
+ #
1780
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.
1781
+ # p result
1782
+ #
1783
+ def list_backups request, options = nil
1784
+ raise ::ArgumentError, "request must be provided" if request.nil?
1785
+
1786
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest
1787
+
1788
+ # Converts hash and nil to an options object
1789
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1790
+
1791
+ # Customize the options with defaults
1792
+ metadata = @config.rpcs.list_backups.metadata.to_h
1793
+
1794
+ # Set x-goog-api-client and x-goog-user-project headers
1795
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1796
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1797
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
1798
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1799
+
1800
+ header_params = {}
1801
+ if request.parent
1802
+ header_params["parent"] = request.parent
1803
+ end
1804
+
1805
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1806
+ metadata[:"x-goog-request-params"] ||= request_params_header
1807
+
1808
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1809
+ metadata: metadata,
1810
+ retry_policy: @config.rpcs.list_backups.retry_policy
1811
+
1812
+ options.apply_defaults timeout: @config.timeout,
1813
+ metadata: @config.metadata,
1814
+ retry_policy: @config.retry_policy
1815
+
1816
+ @firestore_admin_stub.call_rpc :list_backups, request, options: options do |response, operation|
1817
+ yield response, operation if block_given?
1818
+ return response
1819
+ end
1820
+ rescue ::GRPC::BadStatus => e
1821
+ raise ::Google::Cloud::Error.from_error(e)
1822
+ end
1823
+
1824
+ ##
1825
+ # Deletes a backup.
1826
+ #
1827
+ # @overload delete_backup(request, options = nil)
1828
+ # Pass arguments to `delete_backup` via a request object, either of type
1829
+ # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash.
1830
+ #
1831
+ # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::Hash]
1832
+ # A request object representing the call parameters. Required. To specify no
1833
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1834
+ # @param options [::Gapic::CallOptions, ::Hash]
1835
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1836
+ #
1837
+ # @overload delete_backup(name: nil)
1838
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1839
+ # least one keyword argument is required. To specify no parameters, or to keep all
1840
+ # the default parameter values, pass an empty Hash as a request object (see above).
1841
+ #
1842
+ # @param name [::String]
1843
+ # Required. Name of the backup to delete.
1844
+ #
1845
+ # format is `projects/{project}/locations/{location}/backups/{backup}`.
1846
+ #
1847
+ # @yield [response, operation] Access the result along with the RPC operation
1848
+ # @yieldparam response [::Google::Protobuf::Empty]
1849
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1850
+ #
1851
+ # @return [::Google::Protobuf::Empty]
1852
+ #
1853
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1854
+ #
1855
+ # @example Basic example
1856
+ # require "google/cloud/firestore/admin/v1"
1857
+ #
1858
+ # # Create a client object. The client can be reused for multiple calls.
1859
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1860
+ #
1861
+ # # Create a request. To set request fields, pass in keyword arguments.
1862
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new
1863
+ #
1864
+ # # Call the delete_backup method.
1865
+ # result = client.delete_backup request
1866
+ #
1867
+ # # The returned object is of type Google::Protobuf::Empty.
1868
+ # p result
1869
+ #
1870
+ def delete_backup request, options = nil
1871
+ raise ::ArgumentError, "request must be provided" if request.nil?
1872
+
1873
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest
1874
+
1875
+ # Converts hash and nil to an options object
1876
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1877
+
1878
+ # Customize the options with defaults
1879
+ metadata = @config.rpcs.delete_backup.metadata.to_h
1880
+
1881
+ # Set x-goog-api-client and x-goog-user-project headers
1882
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1883
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1884
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
1885
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1886
+
1887
+ header_params = {}
1888
+ if request.name
1889
+ header_params["name"] = request.name
1890
+ end
1891
+
1892
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1893
+ metadata[:"x-goog-request-params"] ||= request_params_header
1894
+
1895
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1896
+ metadata: metadata,
1897
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1898
+
1899
+ options.apply_defaults timeout: @config.timeout,
1900
+ metadata: @config.metadata,
1901
+ retry_policy: @config.retry_policy
1902
+
1903
+ @firestore_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation|
1904
+ yield response, operation if block_given?
1905
+ return response
1906
+ end
1907
+ rescue ::GRPC::BadStatus => e
1908
+ raise ::Google::Cloud::Error.from_error(e)
1909
+ end
1910
+
1911
+ ##
1912
+ # Creates a new database by restoring from an existing backup.
1913
+ #
1914
+ # The new database must be in the same cloud region or multi-region location
1915
+ # as the existing backup. This behaves similar to
1916
+ # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
1917
+ # except instead of creating a new empty database, a new database is created
1918
+ # with the database type, index configuration, and documents from an existing
1919
+ # backup.
1920
+ #
1921
+ # The {::Google::Longrunning::Operation long-running operation} can be used to
1922
+ # track the progress of the restore, with the Operation's
1923
+ # {::Google::Longrunning::Operation#metadata metadata} field type being the
1924
+ # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}.
1925
+ # The {::Google::Longrunning::Operation#response response} type is the
1926
+ # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was
1927
+ # successful. The new database is not readable or writeable until the LRO has
1928
+ # completed.
1929
+ #
1930
+ # @overload restore_database(request, options = nil)
1931
+ # Pass arguments to `restore_database` via a request object, either of type
1932
+ # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash.
1933
+ #
1934
+ # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::Hash]
1935
+ # A request object representing the call parameters. Required. To specify no
1936
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1937
+ # @param options [::Gapic::CallOptions, ::Hash]
1938
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1939
+ #
1940
+ # @overload restore_database(parent: nil, database_id: nil, backup: nil)
1941
+ # Pass arguments to `restore_database` via keyword arguments. Note that at
1942
+ # least one keyword argument is required. To specify no parameters, or to keep all
1943
+ # the default parameter values, pass an empty Hash as a request object (see above).
1944
+ #
1945
+ # @param parent [::String]
1946
+ # Required. The project to restore the database in. Format is
1947
+ # `projects/{project_id}`.
1948
+ # @param database_id [::String]
1949
+ # Required. The ID to use for the database, which will become the final
1950
+ # component of the database's resource name. This database id must not be
1951
+ # associated with an existing database.
1952
+ #
1953
+ # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
1954
+ # with first character a letter and the last a letter or a number. Must not
1955
+ # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
1956
+ #
1957
+ # "(default)" database id is also valid.
1958
+ # @param backup [::String]
1959
+ # Required. Backup to restore from. Must be from the same project as the
1960
+ # parent.
1961
+ #
1962
+ # Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
1963
+ #
1964
+ # @yield [response, operation] Access the result along with the RPC operation
1965
+ # @yieldparam response [::Gapic::Operation]
1966
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1967
+ #
1968
+ # @return [::Gapic::Operation]
1969
+ #
1970
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1971
+ #
1972
+ # @example Basic example
1973
+ # require "google/cloud/firestore/admin/v1"
1974
+ #
1975
+ # # Create a client object. The client can be reused for multiple calls.
1976
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1977
+ #
1978
+ # # Create a request. To set request fields, pass in keyword arguments.
1979
+ # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new
1980
+ #
1981
+ # # Call the restore_database method.
1982
+ # result = client.restore_database request
1983
+ #
1984
+ # # The returned object is of type Gapic::Operation. You can use it to
1985
+ # # check the status of an operation, cancel it, or wait for results.
1986
+ # # Here is how to wait for a response.
1987
+ # result.wait_until_done! timeout: 60
1988
+ # if result.response?
1989
+ # p result.response
1990
+ # else
1991
+ # puts "No response received."
1992
+ # end
1993
+ #
1994
+ def restore_database request, options = nil
1995
+ raise ::ArgumentError, "request must be provided" if request.nil?
1996
+
1997
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest
1998
+
1999
+ # Converts hash and nil to an options object
2000
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2001
+
2002
+ # Customize the options with defaults
2003
+ metadata = @config.rpcs.restore_database.metadata.to_h
2004
+
2005
+ # Set x-goog-api-client and x-goog-user-project headers
2006
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2007
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2008
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2009
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2010
+
2011
+ header_params = {}
2012
+ if request.parent
2013
+ header_params["parent"] = request.parent
2014
+ end
2015
+
2016
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2017
+ metadata[:"x-goog-request-params"] ||= request_params_header
2018
+
2019
+ options.apply_defaults timeout: @config.rpcs.restore_database.timeout,
2020
+ metadata: metadata,
2021
+ retry_policy: @config.rpcs.restore_database.retry_policy
2022
+
2023
+ options.apply_defaults timeout: @config.timeout,
2024
+ metadata: @config.metadata,
2025
+ retry_policy: @config.retry_policy
2026
+
2027
+ @firestore_admin_stub.call_rpc :restore_database, request, options: options do |response, operation|
2028
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2029
+ yield response, operation if block_given?
2030
+ return response
2031
+ end
2032
+ rescue ::GRPC::BadStatus => e
2033
+ raise ::Google::Cloud::Error.from_error(e)
2034
+ end
2035
+
2036
+ ##
2037
+ # Creates a backup schedule on a database.
2038
+ # At most two backup schedules can be configured on a database, one daily
2039
+ # backup schedule with retention up to 7 days and one weekly backup schedule
2040
+ # with retention up to 14 weeks.
2041
+ #
2042
+ # @overload create_backup_schedule(request, options = nil)
2043
+ # Pass arguments to `create_backup_schedule` via a request object, either of type
2044
+ # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash.
2045
+ #
2046
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::Hash]
2047
+ # A request object representing the call parameters. Required. To specify no
2048
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2049
+ # @param options [::Gapic::CallOptions, ::Hash]
2050
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2051
+ #
2052
+ # @overload create_backup_schedule(parent: nil, backup_schedule: nil)
2053
+ # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at
2054
+ # least one keyword argument is required. To specify no parameters, or to keep all
2055
+ # the default parameter values, pass an empty Hash as a request object (see above).
2056
+ #
2057
+ # @param parent [::String]
2058
+ # Required. The parent database.
2059
+ #
2060
+ # Format `projects/{project}/databases/{database}`
2061
+ # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash]
2062
+ # Required. The backup schedule to create.
2063
+ #
2064
+ # @yield [response, operation] Access the result along with the RPC operation
2065
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2066
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2067
+ #
2068
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2069
+ #
2070
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2071
+ #
2072
+ # @example Basic example
2073
+ # require "google/cloud/firestore/admin/v1"
2074
+ #
2075
+ # # Create a client object. The client can be reused for multiple calls.
2076
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
2077
+ #
2078
+ # # Create a request. To set request fields, pass in keyword arguments.
2079
+ # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new
2080
+ #
2081
+ # # Call the create_backup_schedule method.
2082
+ # result = client.create_backup_schedule request
2083
+ #
2084
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
2085
+ # p result
2086
+ #
2087
+ def create_backup_schedule request, options = nil
2088
+ raise ::ArgumentError, "request must be provided" if request.nil?
2089
+
2090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest
2091
+
2092
+ # Converts hash and nil to an options object
2093
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2094
+
2095
+ # Customize the options with defaults
2096
+ metadata = @config.rpcs.create_backup_schedule.metadata.to_h
2097
+
2098
+ # Set x-goog-api-client and x-goog-user-project headers
2099
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2100
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2101
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2102
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2103
+
2104
+ header_params = {}
2105
+ if request.parent
2106
+ header_params["parent"] = request.parent
2107
+ end
2108
+
2109
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2110
+ metadata[:"x-goog-request-params"] ||= request_params_header
2111
+
2112
+ options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout,
2113
+ metadata: metadata,
2114
+ retry_policy: @config.rpcs.create_backup_schedule.retry_policy
2115
+
2116
+ options.apply_defaults timeout: @config.timeout,
2117
+ metadata: @config.metadata,
2118
+ retry_policy: @config.retry_policy
2119
+
2120
+ @firestore_admin_stub.call_rpc :create_backup_schedule, request, options: options do |response, operation|
2121
+ yield response, operation if block_given?
2122
+ return response
2123
+ end
2124
+ rescue ::GRPC::BadStatus => e
2125
+ raise ::Google::Cloud::Error.from_error(e)
2126
+ end
2127
+
2128
+ ##
2129
+ # Gets information about a backup schedule.
2130
+ #
2131
+ # @overload get_backup_schedule(request, options = nil)
2132
+ # Pass arguments to `get_backup_schedule` via a request object, either of type
2133
+ # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash.
2134
+ #
2135
+ # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::Hash]
2136
+ # A request object representing the call parameters. Required. To specify no
2137
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2138
+ # @param options [::Gapic::CallOptions, ::Hash]
2139
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2140
+ #
2141
+ # @overload get_backup_schedule(name: nil)
2142
+ # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at
2143
+ # least one keyword argument is required. To specify no parameters, or to keep all
2144
+ # the default parameter values, pass an empty Hash as a request object (see above).
2145
+ #
2146
+ # @param name [::String]
2147
+ # Required. The name of the backup schedule.
2148
+ #
2149
+ # Format
2150
+ # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
2151
+ #
2152
+ # @yield [response, operation] Access the result along with the RPC operation
2153
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2154
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2155
+ #
2156
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2157
+ #
2158
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2159
+ #
2160
+ # @example Basic example
2161
+ # require "google/cloud/firestore/admin/v1"
2162
+ #
2163
+ # # Create a client object. The client can be reused for multiple calls.
2164
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
2165
+ #
2166
+ # # Create a request. To set request fields, pass in keyword arguments.
2167
+ # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new
2168
+ #
2169
+ # # Call the get_backup_schedule method.
2170
+ # result = client.get_backup_schedule request
2171
+ #
2172
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
2173
+ # p result
2174
+ #
2175
+ def get_backup_schedule request, options = nil
2176
+ raise ::ArgumentError, "request must be provided" if request.nil?
2177
+
2178
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest
2179
+
2180
+ # Converts hash and nil to an options object
2181
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2182
+
2183
+ # Customize the options with defaults
2184
+ metadata = @config.rpcs.get_backup_schedule.metadata.to_h
2185
+
2186
+ # Set x-goog-api-client and x-goog-user-project headers
2187
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2188
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2189
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2190
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2191
+
2192
+ header_params = {}
2193
+ if request.name
2194
+ header_params["name"] = request.name
2195
+ end
2196
+
2197
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2198
+ metadata[:"x-goog-request-params"] ||= request_params_header
2199
+
2200
+ options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout,
2201
+ metadata: metadata,
2202
+ retry_policy: @config.rpcs.get_backup_schedule.retry_policy
2203
+
2204
+ options.apply_defaults timeout: @config.timeout,
2205
+ metadata: @config.metadata,
2206
+ retry_policy: @config.retry_policy
2207
+
2208
+ @firestore_admin_stub.call_rpc :get_backup_schedule, request, options: options do |response, operation|
2209
+ yield response, operation if block_given?
2210
+ return response
2211
+ end
2212
+ rescue ::GRPC::BadStatus => e
2213
+ raise ::Google::Cloud::Error.from_error(e)
2214
+ end
2215
+
2216
+ ##
2217
+ # List backup schedules.
2218
+ #
2219
+ # @overload list_backup_schedules(request, options = nil)
2220
+ # Pass arguments to `list_backup_schedules` via a request object, either of type
2221
+ # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash.
2222
+ #
2223
+ # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::Hash]
2224
+ # A request object representing the call parameters. Required. To specify no
2225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2226
+ # @param options [::Gapic::CallOptions, ::Hash]
2227
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2228
+ #
2229
+ # @overload list_backup_schedules(parent: nil)
2230
+ # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at
2231
+ # least one keyword argument is required. To specify no parameters, or to keep all
2232
+ # the default parameter values, pass an empty Hash as a request object (see above).
2233
+ #
2234
+ # @param parent [::String]
2235
+ # Required. The parent database.
2236
+ #
2237
+ # Format is `projects/{project}/databases/{database}`.
2238
+ #
2239
+ # @yield [response, operation] Access the result along with the RPC operation
2240
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse]
2241
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2242
+ #
2243
+ # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse]
2244
+ #
2245
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2246
+ #
2247
+ # @example Basic example
2248
+ # require "google/cloud/firestore/admin/v1"
2249
+ #
2250
+ # # Create a client object. The client can be reused for multiple calls.
2251
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
2252
+ #
2253
+ # # Create a request. To set request fields, pass in keyword arguments.
2254
+ # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new
2255
+ #
2256
+ # # Call the list_backup_schedules method.
2257
+ # result = client.list_backup_schedules request
2258
+ #
2259
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.
2260
+ # p result
2261
+ #
2262
+ def list_backup_schedules request, options = nil
2263
+ raise ::ArgumentError, "request must be provided" if request.nil?
2264
+
2265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest
2266
+
2267
+ # Converts hash and nil to an options object
2268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2269
+
2270
+ # Customize the options with defaults
2271
+ metadata = @config.rpcs.list_backup_schedules.metadata.to_h
2272
+
2273
+ # Set x-goog-api-client and x-goog-user-project headers
2274
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2276
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2277
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2278
+
2279
+ header_params = {}
2280
+ if request.parent
2281
+ header_params["parent"] = request.parent
2282
+ end
2283
+
2284
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2285
+ metadata[:"x-goog-request-params"] ||= request_params_header
2286
+
2287
+ options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout,
2288
+ metadata: metadata,
2289
+ retry_policy: @config.rpcs.list_backup_schedules.retry_policy
2290
+
2291
+ options.apply_defaults timeout: @config.timeout,
2292
+ metadata: @config.metadata,
2293
+ retry_policy: @config.retry_policy
2294
+
2295
+ @firestore_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation|
2296
+ yield response, operation if block_given?
2297
+ return response
2298
+ end
2299
+ rescue ::GRPC::BadStatus => e
2300
+ raise ::Google::Cloud::Error.from_error(e)
2301
+ end
2302
+
2303
+ ##
2304
+ # Updates a backup schedule.
2305
+ #
2306
+ # @overload update_backup_schedule(request, options = nil)
2307
+ # Pass arguments to `update_backup_schedule` via a request object, either of type
2308
+ # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash.
2309
+ #
2310
+ # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::Hash]
2311
+ # A request object representing the call parameters. Required. To specify no
2312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2313
+ # @param options [::Gapic::CallOptions, ::Hash]
2314
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2315
+ #
2316
+ # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil)
2317
+ # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at
2318
+ # least one keyword argument is required. To specify no parameters, or to keep all
2319
+ # the default parameter values, pass an empty Hash as a request object (see above).
2320
+ #
2321
+ # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash]
2322
+ # Required. The backup schedule to update.
2323
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2324
+ # The list of fields to be updated.
2325
+ #
2326
+ # @yield [response, operation] Access the result along with the RPC operation
2327
+ # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2328
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2329
+ #
2330
+ # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule]
2331
+ #
2332
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2333
+ #
2334
+ # @example Basic example
2335
+ # require "google/cloud/firestore/admin/v1"
2336
+ #
2337
+ # # Create a client object. The client can be reused for multiple calls.
2338
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
2339
+ #
2340
+ # # Create a request. To set request fields, pass in keyword arguments.
2341
+ # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new
2342
+ #
2343
+ # # Call the update_backup_schedule method.
2344
+ # result = client.update_backup_schedule request
2345
+ #
2346
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule.
2347
+ # p result
2348
+ #
2349
+ def update_backup_schedule request, options = nil
2350
+ raise ::ArgumentError, "request must be provided" if request.nil?
2351
+
2352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest
2353
+
2354
+ # Converts hash and nil to an options object
2355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2356
+
2357
+ # Customize the options with defaults
2358
+ metadata = @config.rpcs.update_backup_schedule.metadata.to_h
2359
+
2360
+ # Set x-goog-api-client and x-goog-user-project headers
2361
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2363
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2364
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2365
+
2366
+ header_params = {}
2367
+ if request.backup_schedule&.name
2368
+ header_params["backup_schedule.name"] = request.backup_schedule.name
2369
+ end
2370
+
2371
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2372
+ metadata[:"x-goog-request-params"] ||= request_params_header
2373
+
2374
+ options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout,
2375
+ metadata: metadata,
2376
+ retry_policy: @config.rpcs.update_backup_schedule.retry_policy
2377
+
2378
+ options.apply_defaults timeout: @config.timeout,
2379
+ metadata: @config.metadata,
2380
+ retry_policy: @config.retry_policy
2381
+
2382
+ @firestore_admin_stub.call_rpc :update_backup_schedule, request, options: options do |response, operation|
2383
+ yield response, operation if block_given?
2384
+ return response
2385
+ end
2386
+ rescue ::GRPC::BadStatus => e
2387
+ raise ::Google::Cloud::Error.from_error(e)
2388
+ end
2389
+
2390
+ ##
2391
+ # Deletes a backup schedule.
2392
+ #
2393
+ # @overload delete_backup_schedule(request, options = nil)
2394
+ # Pass arguments to `delete_backup_schedule` via a request object, either of type
2395
+ # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash.
2396
+ #
2397
+ # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::Hash]
2398
+ # A request object representing the call parameters. Required. To specify no
2399
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2400
+ # @param options [::Gapic::CallOptions, ::Hash]
2401
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2402
+ #
2403
+ # @overload delete_backup_schedule(name: nil)
2404
+ # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at
2405
+ # least one keyword argument is required. To specify no parameters, or to keep all
2406
+ # the default parameter values, pass an empty Hash as a request object (see above).
2407
+ #
2408
+ # @param name [::String]
2409
+ # Required. The name of the backup schedule.
2410
+ #
2411
+ # Format
2412
+ # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
2413
+ #
2414
+ # @yield [response, operation] Access the result along with the RPC operation
2415
+ # @yieldparam response [::Google::Protobuf::Empty]
2416
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2417
+ #
2418
+ # @return [::Google::Protobuf::Empty]
2419
+ #
2420
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2421
+ #
2422
+ # @example Basic example
2423
+ # require "google/cloud/firestore/admin/v1"
2424
+ #
2425
+ # # Create a client object. The client can be reused for multiple calls.
2426
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
2427
+ #
2428
+ # # Create a request. To set request fields, pass in keyword arguments.
2429
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new
2430
+ #
2431
+ # # Call the delete_backup_schedule method.
2432
+ # result = client.delete_backup_schedule request
2433
+ #
2434
+ # # The returned object is of type Google::Protobuf::Empty.
2435
+ # p result
2436
+ #
2437
+ def delete_backup_schedule request, options = nil
2438
+ raise ::ArgumentError, "request must be provided" if request.nil?
2439
+
2440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest
2441
+
2442
+ # Converts hash and nil to an options object
2443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2444
+
2445
+ # Customize the options with defaults
2446
+ metadata = @config.rpcs.delete_backup_schedule.metadata.to_h
2447
+
2448
+ # Set x-goog-api-client and x-goog-user-project headers
2449
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2451
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
2452
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2453
+
2454
+ header_params = {}
2455
+ if request.name
2456
+ header_params["name"] = request.name
2457
+ end
2458
+
2459
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2460
+ metadata[:"x-goog-request-params"] ||= request_params_header
2461
+
2462
+ options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout,
2463
+ metadata: metadata,
2464
+ retry_policy: @config.rpcs.delete_backup_schedule.retry_policy
2465
+
2466
+ options.apply_defaults timeout: @config.timeout,
2467
+ metadata: @config.metadata,
2468
+ retry_policy: @config.retry_policy
2469
+
2470
+ @firestore_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation|
2471
+ yield response, operation if block_given?
2472
+ return response
2473
+ end
2474
+ rescue ::GRPC::BadStatus => e
2475
+ raise ::Google::Cloud::Error.from_error(e)
2476
+ end
2477
+
1647
2478
  ##
1648
2479
  # Configuration class for the FirestoreAdmin API.
1649
2480
  #
@@ -1867,6 +2698,51 @@ module Google
1867
2698
  # @return [::Gapic::Config::Method]
1868
2699
  #
1869
2700
  attr_reader :delete_database
2701
+ ##
2702
+ # RPC-specific configuration for `get_backup`
2703
+ # @return [::Gapic::Config::Method]
2704
+ #
2705
+ attr_reader :get_backup
2706
+ ##
2707
+ # RPC-specific configuration for `list_backups`
2708
+ # @return [::Gapic::Config::Method]
2709
+ #
2710
+ attr_reader :list_backups
2711
+ ##
2712
+ # RPC-specific configuration for `delete_backup`
2713
+ # @return [::Gapic::Config::Method]
2714
+ #
2715
+ attr_reader :delete_backup
2716
+ ##
2717
+ # RPC-specific configuration for `restore_database`
2718
+ # @return [::Gapic::Config::Method]
2719
+ #
2720
+ attr_reader :restore_database
2721
+ ##
2722
+ # RPC-specific configuration for `create_backup_schedule`
2723
+ # @return [::Gapic::Config::Method]
2724
+ #
2725
+ attr_reader :create_backup_schedule
2726
+ ##
2727
+ # RPC-specific configuration for `get_backup_schedule`
2728
+ # @return [::Gapic::Config::Method]
2729
+ #
2730
+ attr_reader :get_backup_schedule
2731
+ ##
2732
+ # RPC-specific configuration for `list_backup_schedules`
2733
+ # @return [::Gapic::Config::Method]
2734
+ #
2735
+ attr_reader :list_backup_schedules
2736
+ ##
2737
+ # RPC-specific configuration for `update_backup_schedule`
2738
+ # @return [::Gapic::Config::Method]
2739
+ #
2740
+ attr_reader :update_backup_schedule
2741
+ ##
2742
+ # RPC-specific configuration for `delete_backup_schedule`
2743
+ # @return [::Gapic::Config::Method]
2744
+ #
2745
+ attr_reader :delete_backup_schedule
1870
2746
 
1871
2747
  # @private
1872
2748
  def initialize parent_rpcs = nil
@@ -1898,6 +2774,24 @@ module Google
1898
2774
  @update_database = ::Gapic::Config::Method.new update_database_config
1899
2775
  delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database
1900
2776
  @delete_database = ::Gapic::Config::Method.new delete_database_config
2777
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2778
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2779
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2780
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2781
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2782
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2783
+ restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database
2784
+ @restore_database = ::Gapic::Config::Method.new restore_database_config
2785
+ create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule
2786
+ @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config
2787
+ get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule
2788
+ @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config
2789
+ list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules
2790
+ @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config
2791
+ update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule
2792
+ @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
2793
+ delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
2794
+ @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
1901
2795
 
1902
2796
  yield self if block_given?
1903
2797
  end