Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/typespec-rust/.scripts/tspcompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const httpSpecsGroup = {
};

const azureHttpSpecsGroup = {
//'spector_access': {input: 'azure/client-generator-core/access'},
'spector_access': {input: 'azure/client-generator-core/access'},
'spector_apiverheader': {input: 'azure/client-generator-core/api-version/header/client.tsp'},
'spector_apiverpath': {input: 'azure/client-generator-core/api-version/path/client.tsp'},
'spector_apiverquery': {input: 'azure/client-generator-core/api-version/query/client.tsp'},
Expand Down
9 changes: 9 additions & 0 deletions packages/typespec-rust/test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/typespec-rust/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"spector/authentication/http/custom",
"spector/authentication/oauth2",
"spector/authentication/union",
"spector/azure/client-generator-core/access",
"spector/azure/client-generator-core/api-version/header",
"spector/azure/client-generator-core/api-version/path",
"spector/azure/client-generator-core/api-version/query",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "spector_access"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[features]
default = ["azure_core/default"]

[dependencies]
azure_core = { workspace = true }
serde = { workspace = true }

[dev-dependencies]
tokio = { workspace = true }

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use crate::internal_operation::generated::models::{
AccessInternalOperationClientInternalDecoratorInInternalOptions,
AccessInternalOperationClientNoDecoratorInInternalOptions,
AccessInternalOperationClientPublicDecoratorInInternalOptions,
InternalDecoratorModelInInternal, NoDecoratorModelInInternal, PublicDecoratorModelInInternal,
};
use azure_core::{
error::CheckSuccessOptions,
http::{Method, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt},
tracing, Result,
};

#[tracing::client]
pub struct AccessInternalOperationClient {
pub(crate) endpoint: Url,
pub(crate) pipeline: Pipeline,
}

impl AccessInternalOperationClient {
/// Returns the Url associated with this client.
pub fn endpoint(&self) -> &Url {
&self.endpoint
}

///
/// # Arguments
///
/// * `options` - Optional parameters for the request.
#[tracing::function(
"_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.internalDecoratorInInternal"
)]
pub(crate) async fn internal_decorator_in_internal(
&self,
name: &str,
options: Option<AccessInternalOperationClientInternalDecoratorInInternalOptions<'_>>,
) -> Result<Response<InternalDecoratorModelInInternal>> {
let options = options.unwrap_or_default();
let ctx = options.method_options.context.to_borrowed();
let mut url = self.endpoint.clone();
url.append_path(
"/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal",
);
let mut query_builder = url.query_builder();
query_builder.set_pair("name", name);
query_builder.build();
let mut request = Request::new(url, Method::Get);
request.insert_header("accept", "application/json");
let rsp = self
.pipeline
.send(
&ctx,
&mut request,
Some(PipelineSendOptions {
check_success: CheckSuccessOptions {
success_codes: &[200],
},
..Default::default()
}),
)
.await?;
Ok(rsp.into())
}

///
/// # Arguments
///
/// * `options` - Optional parameters for the request.
#[tracing::function(
"_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.noDecoratorInInternal"
)]
pub(crate) async fn no_decorator_in_internal(
&self,
name: &str,
options: Option<AccessInternalOperationClientNoDecoratorInInternalOptions<'_>>,
) -> Result<Response<NoDecoratorModelInInternal>> {
let options = options.unwrap_or_default();
let ctx = options.method_options.context.to_borrowed();
let mut url = self.endpoint.clone();
url.append_path(
"/azure/client-generator-core/access/internalOperation/noDecoratorInInternal",
);
let mut query_builder = url.query_builder();
query_builder.set_pair("name", name);
query_builder.build();
let mut request = Request::new(url, Method::Get);
request.insert_header("accept", "application/json");
let rsp = self
.pipeline
.send(
&ctx,
&mut request,
Some(PipelineSendOptions {
check_success: CheckSuccessOptions {
success_codes: &[200],
},
..Default::default()
}),
)
.await?;
Ok(rsp.into())
}

///
/// # Arguments
///
/// * `options` - Optional parameters for the request.
#[tracing::function(
"_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.publicDecoratorInInternal"
)]
pub(crate) async fn public_decorator_in_internal(
&self,
name: &str,
options: Option<AccessInternalOperationClientPublicDecoratorInInternalOptions<'_>>,
) -> Result<Response<PublicDecoratorModelInInternal>> {
let options = options.unwrap_or_default();
let ctx = options.method_options.context.to_borrowed();
let mut url = self.endpoint.clone();
url.append_path(
"/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal",
);
let mut query_builder = url.query_builder();
query_builder.set_pair("name", name);
query_builder.build();
let mut request = Request::new(url, Method::Get);
request.insert_header("accept", "application/json");
let rsp = self
.pipeline
.send(
&ctx,
&mut request,
Some(PipelineSendOptions {
check_success: CheckSuccessOptions {
success_codes: &[200],
},
..Default::default()
}),
)
.await?;
Ok(rsp.into())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

mod access_internal_operation_client;
pub use access_internal_operation_client::*;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

/// Clients used to communicate with the service.
pub mod clients;
/// Contains all the data structures and types used by the client library.
pub mod models;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use azure_core::{fmt::SafeDebug, http::ClientMethodOptions};

/// Options to be passed to [`AccessInternalOperationClient::internal_decorator_in_internal()`](crate::internal_operation::generated::clients::AccessInternalOperationClient::internal_decorator_in_internal())
#[derive(Clone, Default, SafeDebug)]
pub(crate) struct AccessInternalOperationClientInternalDecoratorInInternalOptions<'a> {
/// Allows customization of the method call.
pub(crate) method_options: ClientMethodOptions<'a>,
}

/// Options to be passed to [`AccessInternalOperationClient::no_decorator_in_internal()`](crate::internal_operation::generated::clients::AccessInternalOperationClient::no_decorator_in_internal())
#[derive(Clone, Default, SafeDebug)]
pub(crate) struct AccessInternalOperationClientNoDecoratorInInternalOptions<'a> {
/// Allows customization of the method call.
pub(crate) method_options: ClientMethodOptions<'a>,
}

/// Options to be passed to [`AccessInternalOperationClient::public_decorator_in_internal()`](crate::internal_operation::generated::clients::AccessInternalOperationClient::public_decorator_in_internal())
#[derive(Clone, Default, SafeDebug)]
pub(crate) struct AccessInternalOperationClientPublicDecoratorInInternalOptions<'a> {
/// Allows customization of the method call.
pub(crate) method_options: ClientMethodOptions<'a>,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

#[allow(clippy::module_inception)]
mod models;
pub use models::*;
pub(crate) mod method_options;
pub(crate) use method_options::*;
Loading
Loading