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 CloudIot hub.

§Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate google_cloudiot1 as cloudiot1;

use cloudiot1::{CloudIot, 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 = CloudIot::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `locations_registries_bind_device_to_gateway(...)`, `locations_registries_create(...)`, `locations_registries_delete(...)`, `locations_registries_devices_config_versions_list(...)`, `locations_registries_devices_create(...)`, `locations_registries_devices_delete(...)`, `locations_registries_devices_get(...)`, `locations_registries_devices_list(...)`, `locations_registries_devices_modify_cloud_to_device_config(...)`, `locations_registries_devices_patch(...)`, `locations_registries_devices_send_command_to_device(...)`, `locations_registries_devices_states_list(...)`, `locations_registries_get(...)`, `locations_registries_get_iam_policy(...)`, `locations_registries_groups_devices_list(...)`, `locations_registries_groups_get_iam_policy(...)`, `locations_registries_groups_set_iam_policy(...)`, `locations_registries_groups_test_iam_permissions(...)`, `locations_registries_list(...)`, `locations_registries_patch(...)`, `locations_registries_set_iam_policy(...)`, `locations_registries_test_iam_permissions(...)` and `locations_registries_unbind_device_from_gateway(...)`
// to build up your call.
let rb = hub.projects();

Implementations§

Source§

impl<'a, C> ProjectMethods<'a, C>

Source

pub fn locations_registries_devices_config_versions_list( &self, name: &str, ) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C>

Create a builder to help you perform the following task:

Lists the last few versions of the device configuration in descending order (i.e.: newest first).

§Arguments
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_devices_states_list( &self, name: &str, ) -> ProjectLocationRegistryDeviceStateListCall<'a, C>

Create a builder to help you perform the following task:

Lists the last few versions of the device state in descending order (i.e.: newest first).

§Arguments
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_devices_create( &self, request: Device, parent: &str, ) -> ProjectLocationRegistryDeviceCreateCall<'a, C>

Create a builder to help you perform the following task:

Creates a device in a device registry.

§Arguments
  • request - No description provided.
  • parent - Required. The name of the device registry where this device should be created. For example, projects/example-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_devices_delete( &self, name: &str, ) -> ProjectLocationRegistryDeviceDeleteCall<'a, C>

Create a builder to help you perform the following task:

Deletes a device.

§Arguments
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_devices_get( &self, name: &str, ) -> ProjectLocationRegistryDeviceGetCall<'a, C>

Create a builder to help you perform the following task:

Gets details about a device.

§Arguments
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_devices_list( &self, parent: &str, ) -> ProjectLocationRegistryDeviceListCall<'a, C>

Create a builder to help you perform the following task:

List devices in a device registry.

§Arguments
  • parent - Required. The device registry path. Required. For example, projects/my-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_devices_modify_cloud_to_device_config( &self, request: ModifyCloudToDeviceConfigRequest, name: &str, ) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C>

Create a builder to help you perform the following task:

Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata.

§Arguments
  • request - No description provided.
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_devices_patch( &self, request: Device, name: &str, ) -> ProjectLocationRegistryDevicePatchCall<'a, C>

Create a builder to help you perform the following task:

Updates a device.

§Arguments
  • request - No description provided.
  • name - The resource path name. For example, projects/p1/locations/us-central1/registries/registry0/devices/dev0 or projects/p1/locations/us-central1/registries/registry0/devices/{num_id}. When name is populated as a response from the service, it always ends in the device numeric ID.
Source

pub fn locations_registries_devices_send_command_to_device( &self, request: SendCommandToDeviceRequest, name: &str, ) -> ProjectLocationRegistryDeviceSendCommandToDeviceCall<'a, C>

Create a builder to help you perform the following task:

Sends a command to the specified device. In order for a device to be able to receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT protocol, and 2) be subscribed to the group of MQTT topics specified by /devices/{device-id}/commands/#. This subscription will receive commands at the top-level topic /devices/{device-id}/commands as well as commands for subfolders, like /devices/{device-id}/commands/subfolder. Note that subscribing to specific subfolders is not supported. If the command could not be delivered to the device, this method will return an error; in particular, if the device is not subscribed, this method will return FAILED_PRECONDITION. Otherwise, this method will return OK. If the subscription is QoS 1, at least once delivery will be guaranteed; for QoS 0, no acknowledgment will be expected from the device.

§Arguments
  • request - No description provided.
  • name - Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.
Source

pub fn locations_registries_groups_devices_list( &self, parent: &str, ) -> ProjectLocationRegistryGroupDeviceListCall<'a, C>

Create a builder to help you perform the following task:

List devices in a device registry.

§Arguments
  • parent - Required. The device registry path. Required. For example, projects/my-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_groups_get_iam_policy( &self, request: GetIamPolicyRequest, resource: &str, ) -> ProjectLocationRegistryGroupGetIamPolicyCall<'a, C>

Create a builder to help you perform the following task:

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

§Arguments
  • request - No description provided.
  • 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_registries_groups_set_iam_policy( &self, request: SetIamPolicyRequest, resource: &str, ) -> ProjectLocationRegistryGroupSetIamPolicyCall<'a, C>

Create a builder to help you perform the following task:

Sets the access control policy on the specified resource. 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_registries_groups_test_iam_permissions( &self, request: TestIamPermissionsRequest, resource: &str, ) -> ProjectLocationRegistryGroupTestIamPermissionCall<'a, C>

Create a builder to help you perform the following task:

Returns permissions that a caller has on the specified resource. If the resource 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_registries_bind_device_to_gateway( &self, request: BindDeviceToGatewayRequest, parent: &str, ) -> ProjectLocationRegistryBindDeviceToGatewayCall<'a, C>

Create a builder to help you perform the following task:

Associates the device with the gateway.

§Arguments
  • request - No description provided.
  • parent - Required. The name of the registry. For example, projects/example-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_create( &self, request: DeviceRegistry, parent: &str, ) -> ProjectLocationRegistryCreateCall<'a, C>

Create a builder to help you perform the following task:

Creates a device registry that contains devices.

§Arguments
  • request - No description provided.
  • parent - Required. The project and cloud region where this device registry must be created. For example, projects/example-project/locations/us-central1.
Source

pub fn locations_registries_delete( &self, name: &str, ) -> ProjectLocationRegistryDeleteCall<'a, C>

Create a builder to help you perform the following task:

Deletes a device registry configuration.

§Arguments
  • name - Required. The name of the device registry. For example, projects/example-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_get( &self, name: &str, ) -> ProjectLocationRegistryGetCall<'a, C>

Create a builder to help you perform the following task:

Gets a device registry configuration.

§Arguments
  • name - Required. The name of the device registry. For example, projects/example-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_get_iam_policy( &self, request: GetIamPolicyRequest, resource: &str, ) -> ProjectLocationRegistryGetIamPolicyCall<'a, C>

Create a builder to help you perform the following task:

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

§Arguments
  • request - No description provided.
  • 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_registries_list( &self, parent: &str, ) -> ProjectLocationRegistryListCall<'a, C>

Create a builder to help you perform the following task:

Lists device registries.

§Arguments
  • parent - Required. The project and cloud region path. For example, projects/example-project/locations/us-central1.
Source

pub fn locations_registries_patch( &self, request: DeviceRegistry, name: &str, ) -> ProjectLocationRegistryPatchCall<'a, C>

Create a builder to help you perform the following task:

Updates a device registry configuration.

§Arguments
  • request - No description provided.
  • name - The resource path name. For example, projects/example-project/locations/us-central1/registries/my-registry.
Source

pub fn locations_registries_set_iam_policy( &self, request: SetIamPolicyRequest, resource: &str, ) -> ProjectLocationRegistrySetIamPolicyCall<'a, C>

Create a builder to help you perform the following task:

Sets the access control policy on the specified resource. 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_registries_test_iam_permissions( &self, request: TestIamPermissionsRequest, resource: &str, ) -> ProjectLocationRegistryTestIamPermissionCall<'a, C>

Create a builder to help you perform the following task:

Returns permissions that a caller has on the specified resource. If the resource 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_registries_unbind_device_from_gateway( &self, request: UnbindDeviceFromGatewayRequest, parent: &str, ) -> ProjectLocationRegistryUnbindDeviceFromGatewayCall<'a, C>

Create a builder to help you perform the following task:

Deletes the association between the device and the gateway.

§Arguments
  • request - No description provided.
  • parent - Required. The name of the registry. For example, projects/example-project/locations/us-central1/registries/my-registry.

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,