Struct ProjectMethods

Source
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>

Source

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.
Source

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 format projects/*/locations/*
Source

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.
Source

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.
Source

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 format projects/*/locations/*.
Source

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.
Source

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.
Source

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 format projects/*/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.
Source

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 pattern projects/*/locations/*/functions/*
Source

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.
Source

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.
Source

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§

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,