pub struct ProjectMethods<'a, C>where
C: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on project resources.
It is not used directly, but through the CloudFunctions
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_cloudfunctions1 as cloudfunctions1;
use cloudfunctions1::{CloudFunctions, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = CloudFunctions::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `locations_functions_call(...)`, `locations_functions_create(...)`, `locations_functions_delete(...)`, `locations_functions_generate_download_url(...)`, `locations_functions_generate_upload_url(...)`, `locations_functions_get(...)`, `locations_functions_get_iam_policy(...)`, `locations_functions_list(...)`, `locations_functions_patch(...)`, `locations_functions_set_iam_policy(...)`, `locations_functions_test_iam_permissions(...)` and `locations_list(...)`
// to build up your call.
let rb = hub.projects();
Implementations§
Source§impl<'a, C> ProjectMethods<'a, C>
impl<'a, C> ProjectMethods<'a, C>
Sourcepub fn locations_functions_call(
&self,
request: CallFunctionRequest,
name: &str,
) -> ProjectLocationFunctionCallCall<'a, C>
pub fn locations_functions_call( &self, request: CallFunctionRequest, name: &str, ) -> ProjectLocationFunctionCallCall<'a, C>
Create a builder to help you perform the following task:
Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.
§Arguments
request
- No description provided.name
- Required. The name of the function to be called.
Sourcepub fn locations_functions_create(
&self,
request: CloudFunction,
location: &str,
) -> ProjectLocationFunctionCreateCall<'a, C>
pub fn locations_functions_create( &self, request: CloudFunction, location: &str, ) -> ProjectLocationFunctionCreateCall<'a, C>
Create a builder to help you perform the following task:
Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return ALREADY_EXISTS
error.
§Arguments
request
- No description provided.location
- Required. The project and location in which the function should be created, specified in the formatprojects/*/locations/*
Sourcepub fn locations_functions_delete(
&self,
name: &str,
) -> ProjectLocationFunctionDeleteCall<'a, C>
pub fn locations_functions_delete( &self, name: &str, ) -> ProjectLocationFunctionDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function.
§Arguments
name
- Required. The name of the function which should be deleted.
Sourcepub fn locations_functions_generate_download_url(
&self,
request: GenerateDownloadUrlRequest,
name: &str,
) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C>
pub fn locations_functions_generate_download_url( &self, request: GenerateDownloadUrlRequest, name: &str, ) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C>
Create a builder to help you perform the following task:
Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls
§Arguments
request
- No description provided.name
- The name of function for which source code Google Cloud Storage signed URL should be generated.
Sourcepub fn locations_functions_generate_upload_url(
&self,
request: GenerateUploadUrlRequest,
parent: &str,
) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C>
pub fn locations_functions_generate_upload_url( &self, request: GenerateUploadUrlRequest, parent: &str, ) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C>
Create a builder to help you perform the following task:
Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * Source file size should not exceed 100MB limit. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, these two headers need to be specified: * content-type: application/zip
* x-goog-content-length-range: 0,104857600
And this header SHOULD NOT be specified: * Authorization: Bearer YOUR_TOKEN
§Arguments
request
- No description provided.parent
- The project and location in which the Google Cloud Storage signed URL should be generated, specified in the formatprojects/*/locations/*
.
Sourcepub fn locations_functions_get(
&self,
name: &str,
) -> ProjectLocationFunctionGetCall<'a, C>
pub fn locations_functions_get( &self, name: &str, ) -> ProjectLocationFunctionGetCall<'a, C>
Create a builder to help you perform the following task:
Returns a function with the given name from the requested project.
§Arguments
name
- Required. The name of the function which details should be obtained.
Sourcepub fn locations_functions_get_iam_policy(
&self,
resource: &str,
) -> ProjectLocationFunctionGetIamPolicyCall<'a, C>
pub fn locations_functions_get_iam_policy( &self, resource: &str, ) -> ProjectLocationFunctionGetIamPolicyCall<'a, C>
Create a builder to help you perform the following task:
Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set.
§Arguments
resource
- REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.
Sourcepub fn locations_functions_list(
&self,
parent: &str,
) -> ProjectLocationFunctionListCall<'a, C>
pub fn locations_functions_list( &self, parent: &str, ) -> ProjectLocationFunctionListCall<'a, C>
Create a builder to help you perform the following task:
Returns a list of functions that belong to the requested project.
§Arguments
parent
- The project and location from which the function should be listed, specified in the formatprojects/*/locations/*
If you want to list functions in all locations, use “-” in place of a location. When listing functions in all locations, if one or more location(s) are unreachable, the response will contain functions from all reachable locations along with the names of any unreachable locations.
Sourcepub fn locations_functions_patch(
&self,
request: CloudFunction,
name: &str,
) -> ProjectLocationFunctionPatchCall<'a, C>
pub fn locations_functions_patch( &self, request: CloudFunction, name: &str, ) -> ProjectLocationFunctionPatchCall<'a, C>
Create a builder to help you perform the following task:
Updates existing function.
§Arguments
request
- No description provided.name
- A user-defined name of the function. Function names must be unique globally and match patternprojects/*/locations/*/functions/*
Sourcepub fn locations_functions_set_iam_policy(
&self,
request: SetIamPolicyRequest,
resource: &str,
) -> ProjectLocationFunctionSetIamPolicyCall<'a, C>
pub fn locations_functions_set_iam_policy( &self, request: SetIamPolicyRequest, resource: &str, ) -> ProjectLocationFunctionSetIamPolicyCall<'a, C>
Create a builder to help you perform the following task:
Sets the IAM access control policy on the specified function. Replaces any existing policy.
§Arguments
request
- No description provided.resource
- REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.
Sourcepub fn locations_functions_test_iam_permissions(
&self,
request: TestIamPermissionsRequest,
resource: &str,
) -> ProjectLocationFunctionTestIamPermissionCall<'a, C>
pub fn locations_functions_test_iam_permissions( &self, request: TestIamPermissionsRequest, resource: &str, ) -> ProjectLocationFunctionTestIamPermissionCall<'a, C>
Create a builder to help you perform the following task:
Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
§Arguments
request
- No description provided.resource
- REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.
Sourcepub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C>
pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C>
Create a builder to help you perform the following task:
Lists information about the supported locations for this service.
§Arguments
name
- The resource that owns the locations collection, if applicable.
Trait Implementations§
impl<'a, C> MethodsBuilder for ProjectMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ProjectMethods<'a, C>
impl<'a, C> !RefUnwindSafe for ProjectMethods<'a, C>
impl<'a, C> Send for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for ProjectMethods<'a, C>
impl<'a, C> !UnwindSafe for ProjectMethods<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more