#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Environment {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub post_startup_script: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "environment::ImageType", tags = "6, 7")]
pub image_type: ::core::option::Option<environment::ImageType>,
}
pub mod environment {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ImageType {
#[prost(message, tag = "6")]
VmImage(super::VmImage),
#[prost(message, tag = "7")]
ContainerImage(super::ContainerImage),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VmImage {
#[prost(string, tag = "1")]
pub project: ::prost::alloc::string::String,
#[prost(oneof = "vm_image::Image", tags = "2, 3")]
pub image: ::core::option::Option<vm_image::Image>,
}
pub mod vm_image {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Image {
#[prost(string, tag = "2")]
ImageName(::prost::alloc::string::String),
#[prost(string, tag = "3")]
ImageFamily(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerImage {
#[prost(string, tag = "1")]
pub repository: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub tag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub post_startup_script: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub proxy_uri: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "6")]
pub instance_owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "7")]
pub service_account: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub machine_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub accelerator_config: ::core::option::Option<instance::AcceleratorConfig>,
#[prost(enumeration = "instance::State", tag = "10")]
pub state: i32,
#[prost(bool, tag = "11")]
pub install_gpu_driver: bool,
#[prost(string, tag = "12")]
pub custom_gpu_driver_path: ::prost::alloc::string::String,
#[prost(enumeration = "instance::DiskType", tag = "13")]
pub boot_disk_type: i32,
#[prost(int64, tag = "14")]
pub boot_disk_size_gb: i64,
#[prost(enumeration = "instance::DiskType", tag = "25")]
pub data_disk_type: i32,
#[prost(int64, tag = "26")]
pub data_disk_size_gb: i64,
#[prost(bool, tag = "27")]
pub no_remove_data_disk: bool,
#[prost(enumeration = "instance::DiskEncryption", tag = "15")]
pub disk_encryption: i32,
#[prost(string, tag = "16")]
pub kms_key: ::prost::alloc::string::String,
#[prost(bool, tag = "17")]
pub no_public_ip: bool,
#[prost(bool, tag = "18")]
pub no_proxy_access: bool,
#[prost(string, tag = "19")]
pub network: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub subnet: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "21")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "22")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(message, optional, tag = "23")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "24")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "instance::Environment", tags = "2, 3")]
pub environment: ::core::option::Option<instance::Environment>,
}
pub mod instance {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AcceleratorConfig {
#[prost(enumeration = "AcceleratorType", tag = "1")]
pub r#type: i32,
#[prost(int64, tag = "2")]
pub core_count: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AcceleratorType {
Unspecified = 0,
NvidiaTeslaK80 = 1,
NvidiaTeslaP100 = 2,
NvidiaTeslaV100 = 3,
NvidiaTeslaP4 = 4,
NvidiaTeslaT4 = 5,
NvidiaTeslaT4Vws = 8,
NvidiaTeslaP100Vws = 9,
NvidiaTeslaP4Vws = 10,
TpuV2 = 6,
TpuV3 = 7,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Starting = 1,
Provisioning = 2,
Active = 3,
Stopping = 4,
Stopped = 5,
Deleted = 6,
Upgrading = 7,
Initializing = 8,
Registering = 9,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DiskType {
Unspecified = 0,
PdStandard = 1,
PdSsd = 2,
PdBalanced = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DiskEncryption {
Unspecified = 0,
Gmek = 1,
Cmek = 2,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Environment {
#[prost(message, tag = "2")]
VmImage(super::VmImage),
#[prost(message, tag = "3")]
ContainerImage(super::ContainerImage),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub target: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub verb: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub status_message: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub requested_cancellation: bool,
#[prost(string, tag = "7")]
pub api_version: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub endpoint: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesResponse {
#[prost(message, repeated, tag = "1")]
pub instances: ::prost::alloc::vec::Vec<Instance>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateInstanceRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instance_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub instance: ::core::option::Option<Instance>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterInstanceRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instance_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetInstanceAcceleratorRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "instance::AcceleratorType", tag = "2")]
pub r#type: i32,
#[prost(int64, tag = "3")]
pub core_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetInstanceMachineTypeRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub machine_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetInstanceLabelsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportInstanceInfoRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vm_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IsInstanceUpgradeableRequest {
#[prost(string, tag = "1")]
pub notebook_instance: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IsInstanceUpgradeableResponse {
#[prost(bool, tag = "1")]
pub upgradeable: bool,
#[prost(string, tag = "2")]
pub upgrade_version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub upgrade_info: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpgradeInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpgradeInstanceInternalRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vm_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEnvironmentsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEnvironmentsResponse {
#[prost(message, repeated, tag = "1")]
pub environments: ::prost::alloc::vec::Vec<Environment>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEnvironmentRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEnvironmentRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub environment_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub environment: ::core::option::Option<Environment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEnvironmentRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod notebook_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " API v1beta1 service for Cloud AI Platform Notebooks."]
#[derive(Debug, Clone)]
pub struct NotebookServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> NotebookServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> NotebookServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
NotebookServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Lists instances in a given project and location."]
pub async fn list_instances(
&mut self,
request: impl tonic::IntoRequest<super::ListInstancesRequest>,
) -> Result<tonic::Response<super::ListInstancesResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/ListInstances",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Instance."]
pub async fn get_instance(
&mut self,
request: impl tonic::IntoRequest<super::GetInstanceRequest>,
) -> Result<tonic::Response<super::Instance>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/GetInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new Instance in a given project and location."]
pub async fn create_instance(
&mut self,
request: impl tonic::IntoRequest<super::CreateInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/CreateInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Registers an existing legacy notebook instance to the Notebooks API server."]
#[doc = " Legacy instances are instances created with the legacy Compute Engine"]
#[doc = " calls. They are not manageable by the Notebooks API out of the box. This"]
#[doc = " call makes these instances manageable by the Notebooks API."]
pub async fn register_instance(
&mut self,
request: impl tonic::IntoRequest<super::RegisterInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/RegisterInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the guest accelerators of a single Instance."]
pub async fn set_instance_accelerator(
&mut self,
request: impl tonic::IntoRequest<super::SetInstanceAcceleratorRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceAccelerator",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the machine type of a single Instance."]
pub async fn set_instance_machine_type(
&mut self,
request: impl tonic::IntoRequest<super::SetInstanceMachineTypeRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceMachineType",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the labels of an Instance."]
pub async fn set_instance_labels(
&mut self,
request: impl tonic::IntoRequest<super::SetInstanceLabelsRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/SetInstanceLabels",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single Instance."]
pub async fn delete_instance(
&mut self,
request: impl tonic::IntoRequest<super::DeleteInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/DeleteInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Starts a notebook instance."]
pub async fn start_instance(
&mut self,
request: impl tonic::IntoRequest<super::StartInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/StartInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Stops a notebook instance."]
pub async fn stop_instance(
&mut self,
request: impl tonic::IntoRequest<super::StopInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/StopInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Resets a notebook instance."]
pub async fn reset_instance(
&mut self,
request: impl tonic::IntoRequest<super::ResetInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/ResetInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Allows notebook instances to"]
#[doc = " report their latest instance information to the Notebooks"]
#[doc = " API server. The server will merge the reported information to"]
#[doc = " the instance metadata store. Do not use this method directly."]
pub async fn report_instance_info(
&mut self,
request: impl tonic::IntoRequest<super::ReportInstanceInfoRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/ReportInstanceInfo",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Check if a notebook instance is upgradable."]
pub async fn is_instance_upgradeable(
&mut self,
request: impl tonic::IntoRequest<super::IsInstanceUpgradeableRequest>,
) -> Result<tonic::Response<super::IsInstanceUpgradeableResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/IsInstanceUpgradeable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Upgrades a notebook instance to the latest version."]
pub async fn upgrade_instance(
&mut self,
request: impl tonic::IntoRequest<super::UpgradeInstanceRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstance",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Allows notebook instances to"]
#[doc = " call this endpoint to upgrade themselves. Do not use this method directly."]
pub async fn upgrade_instance_internal(
&mut self,
request: impl tonic::IntoRequest<super::UpgradeInstanceInternalRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/UpgradeInstanceInternal",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists environments in a project."]
pub async fn list_environments(
&mut self,
request: impl tonic::IntoRequest<super::ListEnvironmentsRequest>,
) -> Result<tonic::Response<super::ListEnvironmentsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/ListEnvironments",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Environment."]
pub async fn get_environment(
&mut self,
request: impl tonic::IntoRequest<super::GetEnvironmentRequest>,
) -> Result<tonic::Response<super::Environment>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/GetEnvironment",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new Environment."]
pub async fn create_environment(
&mut self,
request: impl tonic::IntoRequest<super::CreateEnvironmentRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/CreateEnvironment",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a single Environment."]
pub async fn delete_environment(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEnvironmentRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.notebooks.v1beta1.NotebookService/DeleteEnvironment",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}