#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::de::{value, Deserializer, IntoDeserializer};
use serde::{Deserialize, Serialize, Serializer};
use std::str::FromStr;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AzureSku {
#[doc = "SKU name"]
pub name: azure_sku::Name,
#[doc = "SKU tier"]
pub tier: azure_sku::Tier,
}
impl AzureSku {
pub fn new(name: azure_sku::Name, tier: azure_sku::Tier) -> Self {
Self { name, tier }
}
}
pub mod azure_sku {
use super::*;
#[doc = "SKU name"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(remote = "Name")]
pub enum Name {
S1,
#[serde(skip_deserializing)]
UnknownValue(String),
}
impl FromStr for Name {
type Err = value::Error;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Self::deserialize(s.into_deserializer())
}
}
impl<'de> Deserialize<'de> for Name {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
Ok(deserialized)
}
}
impl Serialize for Name {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::S1 => serializer.serialize_unit_variant("Name", 0u32, "S1"),
Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
}
}
}
#[doc = "SKU tier"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(remote = "Tier")]
pub enum Tier {
Standard,
#[serde(skip_deserializing)]
UnknownValue(String),
}
impl FromStr for Tier {
type Err = value::Error;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Self::deserialize(s.into_deserializer())
}
}
impl<'de> Deserialize<'de> for Tier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
Ok(deserialized)
}
}
impl Serialize for Tier {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::Standard => serializer.serialize_unit_variant("Tier", 0u32, "Standard"),
Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
}
}
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CheckNameRequest {
#[doc = "Workspace collection name"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Resource type"]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
impl CheckNameRequest {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CheckNameResponse {
#[doc = "Specifies a Boolean value that indicates whether the specified Power BI Workspace Collection name is available to use."]
#[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")]
pub name_available: Option<bool>,
#[doc = "Reason why the workspace collection name cannot be used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reason: Option<check_name_response::Reason>,
#[doc = "Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl CheckNameResponse {
pub fn new() -> Self {
Self::default()
}
}
pub mod check_name_response {
use super::*;
#[doc = "Reason why the workspace collection name cannot be used."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(remote = "Reason")]
pub enum Reason {
Unavailable,
Invalid,
#[serde(skip_deserializing)]
UnknownValue(String),
}
impl FromStr for Reason {
type Err = value::Error;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Self::deserialize(s.into_deserializer())
}
}
impl<'de> Deserialize<'de> for Reason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
Ok(deserialized)
}
}
impl Serialize for Reason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::Unavailable => serializer.serialize_unit_variant("Reason", 0u32, "Unavailable"),
Self::Invalid => serializer.serialize_unit_variant("Reason", 1u32, "Invalid"),
Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
}
}
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CreateWorkspaceCollectionRequest {
#[doc = "Azure location"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sku: Option<AzureSku>,
}
impl CreateWorkspaceCollectionRequest {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Display {
#[doc = "The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with \"Microsoft\" for 1st party services."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
#[doc = "The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the \"name\" section."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = "The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub operation: Option<String>,
#[doc = "The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = "The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
}
impl Display {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Error {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
#[serde(
default,
deserialize_with = "azure_core::util::deserialize_null_as_default",
skip_serializing_if = "Vec::is_empty"
)]
pub details: Vec<ErrorDetail>,
}
impl azure_core::Continuable for Error {
type Continuation = String;
fn continuation(&self) -> Option<Self::Continuation> {
None
}
}
impl Error {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ErrorDetail {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
}
impl ErrorDetail {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct MigrateWorkspaceCollectionRequest {
#[doc = "Name of the resource group the Power BI workspace collections will be migrated to."]
#[serde(rename = "targetResourceGroup", default, skip_serializing_if = "Option::is_none")]
pub target_resource_group: Option<String>,
#[serde(
default,
deserialize_with = "azure_core::util::deserialize_null_as_default",
skip_serializing_if = "Vec::is_empty"
)]
pub resources: Vec<String>,
}
impl MigrateWorkspaceCollectionRequest {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Operation {
#[doc = "The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub display: Option<Display>,
}
impl Operation {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct OperationList {
#[serde(
default,
deserialize_with = "azure_core::util::deserialize_null_as_default",
skip_serializing_if = "Vec::is_empty"
)]
pub value: Vec<Operation>,
}
impl OperationList {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct UpdateWorkspaceCollectionRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sku: Option<AzureSku>,
}
impl UpdateWorkspaceCollectionRequest {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Workspace {
#[doc = "Workspace id"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = "Workspace name"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Resource type"]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[doc = "Property bag"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<serde_json::Value>,
}
impl Workspace {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkspaceCollection {
#[doc = "Resource id"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = "Workspace collection name"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Resource type"]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[doc = "Azure location"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sku: Option<AzureSku>,
#[doc = "Properties"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<serde_json::Value>,
}
impl WorkspaceCollection {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkspaceCollectionAccessKey {
#[doc = "Key name"]
#[serde(rename = "keyName", default, skip_serializing_if = "Option::is_none")]
pub key_name: Option<workspace_collection_access_key::KeyName>,
}
impl WorkspaceCollectionAccessKey {
pub fn new() -> Self {
Self::default()
}
}
pub mod workspace_collection_access_key {
use super::*;
#[doc = "Key name"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum KeyName {
#[serde(rename = "key1")]
Key1,
#[serde(rename = "key2")]
Key2,
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkspaceCollectionAccessKeys {
#[doc = "Access key 1"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key1: Option<String>,
#[doc = "Access key 2"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key2: Option<String>,
}
impl WorkspaceCollectionAccessKeys {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkspaceCollectionList {
#[serde(
default,
deserialize_with = "azure_core::util::deserialize_null_as_default",
skip_serializing_if = "Vec::is_empty"
)]
pub value: Vec<WorkspaceCollection>,
}
impl azure_core::Continuable for WorkspaceCollectionList {
type Continuation = String;
fn continuation(&self) -> Option<Self::Continuation> {
None
}
}
impl WorkspaceCollectionList {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkspaceList {
#[serde(
default,
deserialize_with = "azure_core::util::deserialize_null_as_default",
skip_serializing_if = "Vec::is_empty"
)]
pub value: Vec<Workspace>,
}
impl azure_core::Continuable for WorkspaceList {
type Continuation = String;
fn continuation(&self) -> Option<Self::Continuation> {
None
}
}
impl WorkspaceList {
pub fn new() -> Self {
Self::default()
}
}