diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln new file mode 100644 index 000000000000..ea653dd6b539 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VoiceServices.Provisioning", "src\Microsoft.VoiceServices.Provisioning.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VoiceServices.Provisioning.Tests", "tests\Microsoft.VoiceServices.Provisioning.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs new file mode 100644 index 000000000000..7f8f899e06cc --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AccountResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (Optional.IsDefined(ServiceDetails)) + { + writer.WritePropertyName("serviceDetails"u8); + writer.WriteObjectValue(ServiceDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountResource(document.RootElement, options); + } + + internal static AccountResource DeserializeAccountResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string name = default; + string correlationId = default; + AccountServiceDetails serviceDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceDetails = AccountServiceDetails.DeserializeAccountServiceDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + name, + correlationId, + serviceDetails, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountResource)} does not support writing '{options.Format}' format."); + } + } + + AccountResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccountResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccountResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs new file mode 100644 index 000000000000..dddd960e8051 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// An account represents a group of numbers, typically associated with an enterprise. + public partial class AccountResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the account. + /// is null. + public AccountResource(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ServiceProvisioningErrors = new ChangeTrackingList(); + Name = name; + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Name of the account. + /// A user defined identifier used for correlating with external systems. + /// The details of the account. + /// Keeps track of any properties unknown to the library. + internal AccountResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string name, string correlationId, AccountServiceDetails serviceDetails, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + Name = name; + CorrelationId = correlationId; + ServiceDetails = serviceDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AccountResource() + { + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// Name of the account. + public string Name { get; set; } + /// A user defined identifier used for correlating with external systems. + public string CorrelationId { get; set; } + /// The details of the account. + public AccountServiceDetails ServiceDetails { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs new file mode 100644 index 000000000000..75ab8aa1bd65 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AccountServiceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TeamsTenantId)) + { + writer.WritePropertyName("teamsTenantId"u8); + writer.WriteStringValue(TeamsTenantId); + } + if (Optional.IsDefined(TeamsOperatorConnect)) + { + writer.WritePropertyName("teamsOperatorConnect"u8); + writer.WriteObjectValue(TeamsOperatorConnect, options); + } + if (Optional.IsDefined(TeamsDirectRouting)) + { + writer.WritePropertyName("teamsDirectRouting"u8); + writer.WriteObjectValue(TeamsDirectRouting, options); + } + if (Optional.IsDefined(TeamsPhoneMobile)) + { + writer.WritePropertyName("teamsPhoneMobile"u8); + writer.WriteObjectValue(TeamsPhoneMobile, options); + } + if (Optional.IsDefined(ZoomPhoneCloudPeering)) + { + writer.WritePropertyName("zoomPhoneCloudPeering"u8); + writer.WriteObjectValue(ZoomPhoneCloudPeering, options); + } + if (Optional.IsDefined(AzureOperatorCallProtection)) + { + writer.WritePropertyName("azureOperatorCallProtection"u8); + writer.WriteObjectValue(AzureOperatorCallProtection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountServiceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountServiceDetails(document.RootElement, options); + } + + internal static AccountServiceDetails DeserializeAccountServiceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string teamsTenantId = default; + TeamsOperatorConnectAccountDetails teamsOperatorConnect = default; + TeamsDirectRoutingAccountDetails teamsDirectRouting = default; + TeamsPhoneMobileAccountDetails teamsPhoneMobile = default; + ZoomPhoneCloudPeeringAccountDetails zoomPhoneCloudPeering = default; + AzureOperatorCallProtectionAccountDetails azureOperatorCallProtection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("teamsTenantId"u8)) + { + teamsTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("teamsOperatorConnect"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsOperatorConnect = TeamsOperatorConnectAccountDetails.DeserializeTeamsOperatorConnectAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsDirectRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsDirectRouting = TeamsDirectRoutingAccountDetails.DeserializeTeamsDirectRoutingAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsPhoneMobile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsPhoneMobile = TeamsPhoneMobileAccountDetails.DeserializeTeamsPhoneMobileAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("zoomPhoneCloudPeering"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoomPhoneCloudPeering = ZoomPhoneCloudPeeringAccountDetails.DeserializeZoomPhoneCloudPeeringAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("azureOperatorCallProtection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOperatorCallProtection = AzureOperatorCallProtectionAccountDetails.DeserializeAzureOperatorCallProtectionAccountDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountServiceDetails( + teamsTenantId, + teamsOperatorConnect, + teamsDirectRouting, + teamsPhoneMobile, + zoomPhoneCloudPeering, + azureOperatorCallProtection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support writing '{options.Format}' format."); + } + } + + AccountServiceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountServiceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccountServiceDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccountServiceDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs new file mode 100644 index 000000000000..bb7b248c3374 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details of the backend services associated with this Account. + public partial class AccountServiceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccountServiceDetails() + { + } + + /// Initializes a new instance of . + /// The Microsoft Teams Tenant ID of the Account. This can only be updated if no Operator Connect or Teams Phone Mobile numbers are configured in this account. + /// Details for the Teams Operator Connect service on this Account. + /// Details for the Teams Direct Routing service on this Account. + /// Details for the Teams Phone Mobile service on this Account. + /// Details for the Zoom Phone Cloud Peering service on this Account. + /// Details for the Azure Operator Call Protection service on this Account. + /// Keeps track of any properties unknown to the library. + internal AccountServiceDetails(string teamsTenantId, TeamsOperatorConnectAccountDetails teamsOperatorConnect, TeamsDirectRoutingAccountDetails teamsDirectRouting, TeamsPhoneMobileAccountDetails teamsPhoneMobile, ZoomPhoneCloudPeeringAccountDetails zoomPhoneCloudPeering, AzureOperatorCallProtectionAccountDetails azureOperatorCallProtection, IDictionary serializedAdditionalRawData) + { + TeamsTenantId = teamsTenantId; + TeamsOperatorConnect = teamsOperatorConnect; + TeamsDirectRouting = teamsDirectRouting; + TeamsPhoneMobile = teamsPhoneMobile; + ZoomPhoneCloudPeering = zoomPhoneCloudPeering; + AzureOperatorCallProtection = azureOperatorCallProtection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Microsoft Teams Tenant ID of the Account. This can only be updated if no Operator Connect or Teams Phone Mobile numbers are configured in this account. + public string TeamsTenantId { get; set; } + /// Details for the Teams Operator Connect service on this Account. + public TeamsOperatorConnectAccountDetails TeamsOperatorConnect { get; set; } + /// Details for the Teams Direct Routing service on this Account. + public TeamsDirectRoutingAccountDetails TeamsDirectRouting { get; set; } + /// Details for the Teams Phone Mobile service on this Account. + public TeamsPhoneMobileAccountDetails TeamsPhoneMobile { get; set; } + /// Details for the Zoom Phone Cloud Peering service on this Account. + public ZoomPhoneCloudPeeringAccountDetails ZoomPhoneCloudPeering { get; set; } + /// Details for the Azure Operator Call Protection service on this Account. + public AzureOperatorCallProtectionAccountDetails AzureOperatorCallProtection { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs new file mode 100644 index 000000000000..902a7a63468b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs @@ -0,0 +1,2036 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated sub-client. + /// The Accounts sub-client. + public partial class Accounts + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Accounts for mocking. + protected Accounts() + { + } + + /// Initializes a new instance of Accounts. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The to use. + /// The API version to use for this operation. + internal Accounts(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get Account. + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Account using its Name. An Account represents an Enterprise or collection of users. + /// + public virtual async Task> GetAccountResourceAsync(string accountName, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAccountResourceAsync(accountName, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// Get Account. + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Account using its Name. An Account represents an Enterprise or collection of users. + /// + public virtual Response GetAccountResource(string accountName, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAccountResource(accountName, requestConditions, context); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAccountResourceAsync(string accountName, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccountResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountResourceRequest(accountName, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAccountResource(string accountName, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccountResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountResourceRequest(accountName, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or Replace Account. + /// Name of the account. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or replace the details of an Account. + /// + public virtual async Task> CreateOrReplaceAsync(string accountName, AccountResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceAsync(accountName, content, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// Create or Replace Account. + /// Name of the account. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or replace the details of an Account. + /// + public virtual Response CreateOrReplace(string accountName, AccountResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplace(accountName, content, requestConditions, context); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or Replace Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceAsync(string accountName, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountName, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or Replace Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplace(string accountName, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountName, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Whether to delete the child Number resources of the Account, defaults to false. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string accountName, bool? deleteNumbers = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountName, deleteNumbers, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Whether to delete the child Number resources of the Account, defaults to false. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string accountName, bool? deleteNumbers = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountName, deleteNumbers, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or update Numbers. + /// Name of the account. + /// Batch of numbers to create or replace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or update up to 100 Numbers on the specified account. + /// + public virtual async Task> CreateOrUpdateNumbersAsync(string accountName, BatchNumbers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateNumbersAsync(accountName, content, context).ConfigureAwait(false); + return Response.FromValue(BatchNumbers.FromResponse(response), response); + } + + /// Create or update Numbers. + /// Name of the account. + /// Batch of numbers to create or replace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or update up to 100 Numbers on the specified account. + /// + public virtual Response CreateOrUpdateNumbers(string accountName, BatchNumbers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdateNumbers(accountName, content, context); + return Response.FromValue(BatchNumbers.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or update Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateNumbersAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrUpdateNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateNumbersRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdateNumbers(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrUpdateNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateNumbersRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Delete Numbers. + /// Name of the account. + /// Batch numbers to delete. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Delete up to 100 Numbers on the specified account. + /// + public virtual async Task DeleteNumbersAsync(string accountName, BatchNumbersDelete body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await DeleteNumbersAsync(accountName, content, context).ConfigureAwait(false); + return response; + } + + /// Delete Numbers. + /// Name of the account. + /// Batch numbers to delete. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Delete up to 100 Numbers on the specified account. + /// + public virtual Response DeleteNumbers(string accountName, BatchNumbersDelete body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = DeleteNumbers(accountName, content, context); + return response; + } + + /// + /// [Protocol Method] Delete Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteNumbersAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumbersRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Delete Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteNumbers(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumbersRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Number using its telephone number. + /// + public virtual async Task> GetNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetNumberAsync(accountName, telephoneNumber, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// Get Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Number using its telephone number. + /// + public virtual Response GetNumber(string accountName, string telephoneNumber, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetNumber(accountName, telephoneNumber, requestConditions, context); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumberRequest(accountName, telephoneNumber, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetNumber(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumberRequest(accountName, telephoneNumber, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or replace Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Create or replace the details of a Number. + /// + public virtual async Task> CreateOrReplaceNumberAsync(string accountName, string telephoneNumber, NumberResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceNumberAsync(accountName, telephoneNumber, content, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// Create or replace Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Create or replace the details of a Number. + /// + public virtual Response CreateOrReplaceNumber(string accountName, string telephoneNumber, NumberResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplaceNumber(accountName, telephoneNumber, content, requestConditions, context); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or replace Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceNumberAsync(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplaceNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceNumberRequest(accountName, telephoneNumber, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or replace Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceNumber(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplaceNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceNumberRequest(accountName, telephoneNumber, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumberRequest(accountName, telephoneNumber, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteNumber(string accountName, string telephoneNumber, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumberRequest(accountName, telephoneNumber, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Usages. + /// Name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams capability plans on the specified account. + /// + public virtual async Task> GetTeamsCapabilityPlansAsync(string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsCapabilityPlansAsync(accountName, context).ConfigureAwait(false); + return Response.FromValue(TeamsCapabilityPlans.FromResponse(response), response); + } + + /// Get Teams Usages. + /// Name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams capability plans on the specified account. + /// + public virtual Response GetTeamsCapabilityPlans(string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsCapabilityPlans(accountName, context); + return Response.FromValue(TeamsCapabilityPlans.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Usages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsCapabilityPlansAsync(string accountName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCapabilityPlans"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCapabilityPlansRequest(accountName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Usages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsCapabilityPlans(string accountName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCapabilityPlans"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCapabilityPlansRequest(accountName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Available Capabilities. + /// Name of the account. + /// List identifiers for a Number resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Available Capabilities on the specified account. + /// + public virtual async Task> GetTeamsAvailableCapabilitiesAsync(string accountName, NumberIdentifiers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsAvailableCapabilitiesAsync(accountName, content, context).ConfigureAwait(false); + return Response.FromValue(TeamsAvailableCapabilities.FromResponse(response), response); + } + + /// Get Teams Available Capabilities. + /// Name of the account. + /// List identifiers for a Number resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Available Capabilities on the specified account. + /// + public virtual Response GetTeamsAvailableCapabilities(string accountName, NumberIdentifiers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsAvailableCapabilities(accountName, content, context); + return Response.FromValue(TeamsAvailableCapabilities.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Available Capabilities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsAvailableCapabilitiesAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsAvailableCapabilities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsAvailableCapabilitiesRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Available Capabilities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsAvailableCapabilities(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsAvailableCapabilities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsAvailableCapabilitiesRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Civic Address. + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Teams Civic Address using its ID. + /// + public virtual async Task> GetTeamsCivicAddressAsync(string accountName, string civicAddressId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsCivicAddressAsync(accountName, civicAddressId, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(TeamsCivicAddressResource.FromResponse(response), response); + } + + /// Get Teams Civic Address. + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Teams Civic Address using its ID. + /// + public virtual Response GetTeamsCivicAddress(string accountName, string civicAddressId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsCivicAddress(accountName, civicAddressId, requestConditions, context); + return Response.FromValue(TeamsCivicAddressResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Civic Address. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsCivicAddressAsync(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCivicAddress"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCivicAddressRequest(accountName, civicAddressId, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Civic Address. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsCivicAddress(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCivicAddress"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCivicAddressRequest(accountName, civicAddressId, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get list of Accounts. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Accounts with details. An Account represents an Enterprise or collection of users. + /// + public virtual AsyncPageable GetAccountResourcesAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AccountResource.DeserializeAccountResource(e), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// Get list of Accounts. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Accounts with details. An Account represents an Enterprise or collection of users. + /// + public virtual Pageable GetAccountResources(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AccountResource.DeserializeAccountResource(e), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Accounts + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAccountResourcesAsync(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Accounts + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAccountResources(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// Get Numbers. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Numbers on the specified account. + /// + public virtual AsyncPageable GetNumbersAsync(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// Get Numbers. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Numbers on the specified account. + /// + public virtual Pageable GetNumbers(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetNumbersAsync(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetNumbers(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// Get Teams Civic Addresses. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Civic Addresses on the specified account. + /// + public virtual AsyncPageable GetTeamsCivicAddressesAsync(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TeamsCivicAddressResource.DeserializeTeamsCivicAddressResource(e), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// Get Teams Civic Addresses. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Civic Addresses on the specified account. + /// + public virtual Pageable GetTeamsCivicAddresses(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TeamsCivicAddressResource.DeserializeTeamsCivicAddressResource(e), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Teams Civic Addresses. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTeamsCivicAddressesAsync(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Teams Civic Addresses. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTeamsCivicAddresses(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + internal HttpMessage CreateGetAccountResourcesRequest(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAccountResourceRequest(string accountName, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string accountName, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string accountName, bool? deleteNumbers, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (deleteNumbers != null) + { + uri.AppendQuery("deleteNumbers", deleteNumbers.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrUpdateNumbersRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":createOrUpdateNumbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteNumbersRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":deleteNumbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetNumbersRequest(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetNumberRequest(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrReplaceNumberRequest(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteNumberRequest(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetTeamsCapabilityPlansRequest(string accountName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":getTeamsCapabilityPlans", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateGetTeamsAvailableCapabilitiesRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":getTeamsAvailableCapabilities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressesRequest(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/teamsCivicAddresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressRequest(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/teamsCivicAddresses/", false); + uri.AppendPath(civicAddressId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetAccountResourcesNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetNumbersNextPageRequest(string nextLink, string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressesNextPageRequest(string nextLink, string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs new file mode 100644 index 000000000000..23600447e65d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AzureOperatorCallProtectionAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOperatorCallProtectionAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement, options); + } + + internal static AzureOperatorCallProtectionAccountDetails DeserializeAzureOperatorCallProtectionAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOperatorCallProtectionAccountDetails(enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + AzureOperatorCallProtectionAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureOperatorCallProtectionAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs new file mode 100644 index 000000000000..ff69e1df2883 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Azure Operator Call Protection. + public partial class AzureOperatorCallProtectionAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + public AzureOperatorCallProtectionAccountDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal AzureOperatorCallProtectionAccountDetails(bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureOperatorCallProtectionAccountDetails() + { + } + + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs new file mode 100644 index 000000000000..48a9cc10cb77 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AzureOperatorCallProtectionNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOperatorCallProtectionNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement, options); + } + + internal static AzureOperatorCallProtectionNumberDetails DeserializeAzureOperatorCallProtectionNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOperatorCallProtectionNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + AzureOperatorCallProtectionNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureOperatorCallProtectionNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs new file mode 100644 index 000000000000..11c9d47dbe8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Azure Operator Call Protection service on this Number. + public partial class AzureOperatorCallProtectionNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public AzureOperatorCallProtectionNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// Keeps track of any properties unknown to the library. + internal AzureOperatorCallProtectionNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureOperatorCallProtectionNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs new file mode 100644 index 000000000000..e83dda55446e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class BatchNumbers : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbers)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchNumbers IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbers)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNumbers(document.RootElement, options); + } + + internal static BatchNumbers DeserializeBatchNumbers(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberResource.DeserializeNumberResource(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNumbers(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNumbers)} does not support writing '{options.Format}' format."); + } + } + + BatchNumbers IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNumbers(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNumbers)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNumbers FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNumbers(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs new file mode 100644 index 000000000000..2ccea9bd7181 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// List of telephone numbers to be uploaded to an account via a PUT request. + public partial class BatchNumbers + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of numbers to upload. At most 100 can be uploaded in one request. + /// is null. + public BatchNumbers(IEnumerable numbers) + { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); + } + + /// Initializes a new instance of . + /// The list of numbers to upload. At most 100 can be uploaded in one request. + /// Keeps track of any properties unknown to the library. + internal BatchNumbers(IList numbers, IDictionary serializedAdditionalRawData) + { + Numbers = numbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BatchNumbers() + { + } + + /// The list of numbers to upload. At most 100 can be uploaded in one request. + public IList Numbers { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs new file mode 100644 index 000000000000..7b2b00762c05 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class BatchNumbersDelete : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchNumbersDelete IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNumbersDelete(document.RootElement, options); + } + + internal static BatchNumbersDelete DeserializeBatchNumbersDelete(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberIdentifier.DeserializeNumberIdentifier(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNumbersDelete(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support writing '{options.Format}' format."); + } + } + + BatchNumbersDelete IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNumbersDelete(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNumbersDelete FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNumbersDelete(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs new file mode 100644 index 000000000000..f43d15b08138 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A list of telephone numbers to delete. + public partial class BatchNumbersDelete + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of number to delete. At most 100 can be deleted in one request. + /// is null. + public BatchNumbersDelete(IEnumerable numbers) + { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); + } + + /// Initializes a new instance of . + /// The list of number to delete. At most 100 can be deleted in one request. + /// Keeps track of any properties unknown to the library. + internal BatchNumbersDelete(IList numbers, IDictionary serializedAdditionalRawData) + { + Numbers = numbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BatchNumbersDelete() + { + } + + /// The list of number to delete. At most 100 can be deleted in one request. + public IList Numbers { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs new file mode 100644 index 000000000000..c80debdcf447 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ContactDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContactDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W") + { + writer.WritePropertyName("email"u8); + writer.WriteStringValue(Email); + } + if (options.Format != "W" && Optional.IsDefined(TelephoneNumber)) + { + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + } + if (options.Format != "W" && Optional.IsDefined(CompanyName)) + { + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + } + if (options.Format != "W" && Optional.IsDefined(CompanySize)) + { + writer.WritePropertyName("companySize"u8); + writer.WriteStringValue(CompanySize); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContactDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContactDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContactDetails(document.RootElement, options); + } + + internal static ContactDetails DeserializeContactDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fullName = default; + string email = default; + string telephoneNumber = default; + string companyName = default; + string companySize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyName"u8)) + { + companyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("companySize"u8)) + { + companySize = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContactDetails( + fullName, + email, + telephoneNumber, + companyName, + companySize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContactDetails)} does not support writing '{options.Format}' format."); + } + } + + ContactDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContactDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContactDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContactDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContactDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs new file mode 100644 index 000000000000..237740f97fd7 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Contact details for an individual. + public partial class ContactDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContactDetails() + { + } + + /// Initializes a new instance of . + /// The full name of the contact detail. + /// The email of the contact detail. + /// The telephone number of the contact detail. + /// The company name of the contact detail. + /// The company size of the contact detail. + /// Keeps track of any properties unknown to the library. + internal ContactDetails(string fullName, string email, string telephoneNumber, string companyName, string companySize, IDictionary serializedAdditionalRawData) + { + FullName = fullName; + Email = email; + TelephoneNumber = telephoneNumber; + CompanyName = companyName; + CompanySize = companySize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name of the contact detail. + public string FullName { get; } + /// The email of the contact detail. + public string Email { get; } + /// The telephone number of the contact detail. + public string TelephoneNumber { get; } + /// The company name of the contact detail. + public string CompanyName { get; } + /// The company size of the contact detail. + public string CompanySize { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs new file mode 100644 index 000000000000..2b1c902dc0c8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class CustomerRelationship : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && Optional.IsDefined(LastModifiedOn)) + { + writer.WritePropertyName("lastModifiedOn"u8); + writer.WriteStringValue(LastModifiedOn.Value, "O"); + } + if (Optional.IsDefined(Comment)) + { + writer.WritePropertyName("comment"u8); + writer.WriteStringValue(Comment); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomerRelationship IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerRelationship(document.RootElement, options); + } + + internal static CustomerRelationship DeserializeCustomerRelationship(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + DateTimeOffset? lastModifiedOn = default; + string comment = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModifiedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("comment"u8)) + { + comment = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerRelationship(status, lastModifiedOn, comment, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support writing '{options.Format}' format."); + } + } + + CustomerRelationship IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomerRelationship(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CustomerRelationship FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomerRelationship(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs new file mode 100644 index 000000000000..69c90759873f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details of a customer relationship. + public partial class CustomerRelationship + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CustomerRelationship() + { + } + + /// Initializes a new instance of . + /// The status of the customer relationship. + /// The time (ISO8601 format) when the customer relationship is last modified. + /// The comment of the customer relationship. + /// Keeps track of any properties unknown to the library. + internal CustomerRelationship(string status, DateTimeOffset? lastModifiedOn, string comment, IDictionary serializedAdditionalRawData) + { + Status = status; + LastModifiedOn = lastModifiedOn; + Comment = comment; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the customer relationship. + public string Status { get; set; } + /// The time (ISO8601 format) when the customer relationship is last modified. + public DateTimeOffset? LastModifiedOn { get; } + /// The comment of the customer relationship. + public string Comment { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml new file mode 100644 index 000000000000..003ba76aa560 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml @@ -0,0 +1,2507 @@ + + + + + +This sample shows how to call GetAccountResourceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync(""); +]]> +This sample shows how to call GetAccountResourceAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", requestConditions: null); +]]> + + + +This sample shows how to call GetAccountResource. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource(""); +]]> +This sample shows how to call GetAccountResource with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", requestConditions: null); +]]> + + + +This sample shows how to call GetAccountResourceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetAccountResourceAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call GetAccountResource and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetAccountResource with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource(""); +Response response = await client.CreateOrReplaceAsync("", resource); +]]> +This sample shows how to call CreateOrReplaceAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource("") +{ + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, +}; +Response response = await client.CreateOrReplaceAsync("", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplace. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource(""); +Response response = client.CreateOrReplace("", resource); +]]> +This sample shows how to call CreateOrReplace with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource("") +{ + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, +}; +Response response = client.CreateOrReplace("", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", +}); +Response response = await client.CreateOrReplaceAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, +}); +Response response = await client.CreateOrReplaceAsync("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call CreateOrReplace and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", +}); +Response response = client.CreateOrReplace("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplace with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, +}); +Response response = client.CreateOrReplace("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteAsync(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteAsync("", deleteNumbers: true, requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.Delete(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.Delete("", deleteNumbers: true, requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateOrUpdateNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails()) +}); +Response response = await client.CreateOrUpdateNumbersAsync("", body); +]]> +This sample shows how to call CreateOrUpdateNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + } +}); +Response response = await client.CreateOrUpdateNumbersAsync("", body); +]]> + + + +This sample shows how to call CreateOrUpdateNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails()) +}); +Response response = client.CreateOrUpdateNumbers("", body); +]]> +This sample shows how to call CreateOrUpdateNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + } +}); +Response response = client.CreateOrUpdateNumbers("", body); +]]> + + + +This sample shows how to call CreateOrUpdateNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + } + }, +}); +Response response = await client.CreateOrUpdateNumbersAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrUpdateNumbersAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + } + }, +}); +Response response = await client.CreateOrUpdateNumbersAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + } + }, +}); +Response response = client.CreateOrUpdateNumbers("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrUpdateNumbers with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + } + }, +}); +Response response = client.CreateOrUpdateNumbers("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call DeleteNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.DeleteNumbersAsync("", body); +]]> +This sample shows how to call DeleteNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.DeleteNumbersAsync("", body); +]]> + + + +This sample shows how to call DeleteNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.DeleteNumbers("", body); +]]> +This sample shows how to call DeleteNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.DeleteNumbers("", body); +]]> + + + +This sample shows how to call DeleteNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.DeleteNumbersAsync("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumbersAsync with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.DeleteNumbersAsync("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.DeleteNumbers("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumbers with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.DeleteNumbers("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", ""); +]]> +This sample shows how to call GetNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", ""); +]]> +This sample shows how to call GetNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetNumberAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumberAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call GetNumber and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumber with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); +Response response = await client.CreateOrReplaceNumberAsync("", "", resource); +]]> +This sample shows how to call CreateOrReplaceNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails +{ + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, +}; +Response response = await client.CreateOrReplaceNumberAsync("", "", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); +Response response = client.CreateOrReplaceNumber("", "", resource); +]]> +This sample shows how to call CreateOrReplaceNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails +{ + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, +}; +Response response = client.CreateOrReplaceNumber("", "", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceNumberAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), +}); +Response response = await client.CreateOrReplaceNumberAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrReplaceNumberAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, +}); +Response response = await client.CreateOrReplaceNumberAsync("", "", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceNumber and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), +}); +Response response = client.CreateOrReplaceNumber("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrReplaceNumber with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, +}); +Response response = client.CreateOrReplaceNumber("", "", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call DeleteNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteNumberAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteNumberAsync("", "", requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.DeleteNumber("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.DeleteNumber("", "", requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlansAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync(""); +]]> +This sample shows how to call GetTeamsCapabilityPlansAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync(""); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlans. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans(""); +]]> +This sample shows how to call GetTeamsCapabilityPlans with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans(""); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlansAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> +This sample shows how to call GetTeamsCapabilityPlansAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlans and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> +This sample shows how to call GetTeamsCapabilityPlans with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilitiesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); +]]> +This sample shows how to call GetTeamsAvailableCapabilitiesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilities. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.GetTeamsAvailableCapabilities("", body); +]]> +This sample shows how to call GetTeamsAvailableCapabilities with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.GetTeamsAvailableCapabilities("", body); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilitiesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> +This sample shows how to call GetTeamsAvailableCapabilitiesAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilities and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.GetTeamsAvailableCapabilities("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> +This sample shows how to call GetTeamsAvailableCapabilities with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.GetTeamsAvailableCapabilities("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> + + + +This sample shows how to call GetTeamsCivicAddressAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", ""); +]]> +This sample shows how to call GetTeamsCivicAddressAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetTeamsCivicAddress. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", ""); +]]> +This sample shows how to call GetTeamsCivicAddress with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetTeamsCivicAddressAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +]]> +This sample shows how to call GetTeamsCivicAddressAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("houseNumber").ToString()); +Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); +Console.WriteLine(result.GetProperty("preDirectional").ToString()); +Console.WriteLine(result.GetProperty("streetName").ToString()); +Console.WriteLine(result.GetProperty("streetSuffix").ToString()); +Console.WriteLine(result.GetProperty("postDirectional").ToString()); +Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); +Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); +Console.WriteLine(result.GetProperty("cityOrTown").ToString()); +Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); +Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("companyId").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +Console.WriteLine(result.GetProperty("validationStatus").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("partnerId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); +Console.WriteLine(result.GetProperty("latitude").ToString()); +Console.WriteLine(result.GetProperty("longitude").ToString()); +]]> + + + +This sample shows how to call GetTeamsCivicAddress and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +]]> +This sample shows how to call GetTeamsCivicAddress with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("houseNumber").ToString()); +Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); +Console.WriteLine(result.GetProperty("preDirectional").ToString()); +Console.WriteLine(result.GetProperty("streetName").ToString()); +Console.WriteLine(result.GetProperty("streetSuffix").ToString()); +Console.WriteLine(result.GetProperty("postDirectional").ToString()); +Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); +Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); +Console.WriteLine(result.GetProperty("cityOrTown").ToString()); +Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); +Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("companyId").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +Console.WriteLine(result.GetProperty("validationStatus").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("partnerId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); +Console.WriteLine(result.GetProperty("latitude").ToString()); +Console.WriteLine(result.GetProperty("longitude").ToString()); +]]> + + + +This sample shows how to call GetAccountResourcesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (AccountResource item in client.GetAccountResourcesAsync()) +{ +} +]]> +This sample shows how to call GetAccountResourcesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (AccountResource item in client.GetAccountResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetAccountResources. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (AccountResource item in client.GetAccountResources()) +{ +} +]]> +This sample shows how to call GetAccountResources with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (AccountResource item in client.GetAccountResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetAccountResourcesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetAccountResourcesAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetAccountResourcesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetAccountResourcesAsync(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +} +]]> + + + +This sample shows how to call GetAccountResources and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetAccountResources(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetAccountResources with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetAccountResources(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +} +]]> + + + +This sample shows how to call GetNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (NumberResource item in client.GetNumbersAsync("")) +{ +} +]]> +This sample shows how to call GetNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (NumberResource item in client.GetNumbersAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (NumberResource item in client.GetNumbers("")) +{ +} +]]> +This sample shows how to call GetNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (NumberResource item in client.GetNumbers("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetNumbersAsync("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbersAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetNumbersAsync("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + +This sample shows how to call GetNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetNumbers("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbers with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetNumbers("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + +This sample shows how to call GetTeamsCivicAddressesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("")) +{ +} +]]> +This sample shows how to call GetTeamsCivicAddressesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetTeamsCivicAddresses. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("")) +{ +} +]]> +This sample shows how to call GetTeamsCivicAddresses with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetTeamsCivicAddressesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +} +]]> +This sample shows how to call GetTeamsCivicAddressesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); +} +]]> + + + +This sample shows how to call GetTeamsCivicAddresses and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetTeamsCivicAddresses("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +} +]]> +This sample shows how to call GetTeamsCivicAddresses with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetTeamsCivicAddresses("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml new file mode 100644 index 000000000000..0a6481c05eb9 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml @@ -0,0 +1,411 @@ + + + + + +This sample shows how to call GetRequestForInformationAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync(""); +]]> +This sample shows how to call GetRequestForInformationAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", requestConditions: null); +]]> + + + +This sample shows how to call GetRequestForInformation. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation(""); +]]> +This sample shows how to call GetRequestForInformation with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", requestConditions: null); +]]> + + + +This sample shows how to call GetRequestForInformationAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call GetRequestForInformationAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call GetRequestForInformation and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call GetRequestForInformation with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateRequestForInformationAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.CreateOrUpdateRequestForInformationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call CreateOrUpdateRequestForInformationAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new +{ + customerRelationship = new + { + status = "", + comment = "", + }, +}); +Response response = await client.CreateOrUpdateRequestForInformationAsync("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateRequestForInformation and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.CreateOrUpdateRequestForInformation("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call CreateOrUpdateRequestForInformation with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new +{ + customerRelationship = new + { + status = "", + comment = "", + }, +}); +Response response = client.CreateOrUpdateRequestForInformation("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call GetRequestForInformationResourcesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync()) +{ +} +]]> +This sample shows how to call GetRequestForInformationResourcesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetRequestForInformationResources. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (RequestForInformationResource item in client.GetRequestForInformationResources()) +{ +} +]]> +This sample shows how to call GetRequestForInformationResources with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (RequestForInformationResource item in client.GetRequestForInformationResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetRequestForInformationResourcesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); +} +]]> +This sample shows how to call GetRequestForInformationResourcesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +} +]]> + + + +This sample shows how to call GetRequestForInformationResources and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (BinaryData item in client.GetRequestForInformationResources(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); +} +]]> +This sample shows how to call GetRequestForInformationResources with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (BinaryData item in client.GetRequestForInformationResources(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml new file mode 100644 index 000000000000..5f9ee442c7d6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml @@ -0,0 +1,171 @@ + + + + + +This sample shows how to call GetNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = await client.GetNumbersAsync(); +]]> +This sample shows how to call GetNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = await client.GetNumbersAsync(top: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true); +]]> + + + +This sample shows how to call GetNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = client.GetNumbers(); +]]> +This sample shows how to call GetNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = client.GetNumbers(top: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true); +]]> + + + +This sample shows how to call GetNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = await client.GetNumbersAsync(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumbersAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = await client.GetNumbersAsync(1234, 1234, 1234, "", true, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = client.GetNumbers(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumbers with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +Response response = client.GetNumbers(1234, 1234, 1234, "", true, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..17d6ef6480c9 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..b48d55916b5b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..5758e18aa7f5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..f824c3b6f6d6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..4fbe60521490 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..b361c3c8ad5f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs new file mode 100644 index 000000000000..0e231fb62b75 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class Location : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Location)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(AdditionalInfo)) + { + writer.WritePropertyName("additionalInfo"u8); + writer.WriteStringValue(AdditionalInfo); + } + if (options.Format != "W" && Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"u8); + writer.WriteBooleanValue(IsDefault.Value); + } + if (options.Format != "W" && Optional.IsDefined(Elin)) + { + writer.WritePropertyName("elin"u8); + writer.WriteStringValue(Elin); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Location IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Location)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocation(document.RootElement, options); + } + + internal static Location DeserializeLocation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string civicAddressId = default; + string description = default; + string additionalInfo = default; + bool? isDefault = default; + string elin = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalInfo"u8)) + { + additionalInfo = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("elin"u8)) + { + elin = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Location( + id, + civicAddressId, + description, + additionalInfo, + isDefault, + elin, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Location)} does not support writing '{options.Format}' format."); + } + } + + Location IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLocation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Location)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Location FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLocation(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs new file mode 100644 index 000000000000..99fffa04d81a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A location used by Team Operator Connect or Teams Phone Mobile telephone numbers. + public partial class Location + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal Location() + { + } + + /// Initializes a new instance of . + /// The ID of the location. + /// The civic address ID of the location. + /// The description of the location. + /// The additional information of the location. + /// Flag indicating whether the location is default or not. + /// The elin (Emergency Location Identification Number) of the location. + /// Keeps track of any properties unknown to the library. + internal Location(string id, string civicAddressId, string description, string additionalInfo, bool? isDefault, string elin, IDictionary serializedAdditionalRawData) + { + Id = id; + CivicAddressId = civicAddressId; + Description = description; + AdditionalInfo = additionalInfo; + IsDefault = isDefault; + Elin = elin; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the location. + public string Id { get; } + /// The civic address ID of the location. + public string CivicAddressId { get; } + /// The description of the location. + public string Description { get; } + /// The additional information of the location. + public string AdditionalInfo { get; } + /// Flag indicating whether the location is default or not. + public bool? IsDefault { get; } + /// The elin (Emergency Location Identification Number) of the location. + public string Elin { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs new file mode 100644 index 000000000000..ebbbc8d07fd2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Microsoft.VoiceServices.Provisioning; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class MicrosoftVoiceServicesProvisioningClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The to use. + public static IAzureClientBuilder AddVoiceServicesClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new VoiceServicesClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddVoiceServicesClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs new file mode 100644 index 000000000000..a2dbafb82816 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Model factory for models. + public static partial class MicrosoftVoiceServicesProvisioningModelFactory + { + /// Initializes a new instance of . + /// The NumberResource items on this page. + /// The link to the next page of items. + /// A new instance for mocking. + public static PagedNumberList PagedNumberList(IEnumerable value = null, Uri nextLink = null) + { + value ??= new List(); + + return new PagedNumberList(value?.ToList(), nextLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// Configuration for this number. + /// A new instance for mocking. + public static NumberResource NumberResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string telephoneNumber = null, string accountName = null, NumberServiceDetails serviceDetails = null, NumberConfiguration configuration = null) + { + serviceProvisioningErrors ??= new List(); + + return new NumberResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + telephoneNumber, + accountName, + serviceDetails, + configuration, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// A new instance for mocking. + public static TeamsOperatorConnectNumberConfig TeamsOperatorConnectNumberConfig(string usage = null, IEnumerable choosableCapabilities = null, IEnumerable acquiredCapabilities = null, IEnumerable availableCapabilities = null, IEnumerable additionalUsages = null, string civicAddressId = null, string locationId = null, bool? allowTenantAddressUpdate = null, string displayedCountryCode = null) + { + choosableCapabilities ??= new List(); + acquiredCapabilities ??= new List(); + availableCapabilities ??= new List(); + additionalUsages ??= new List(); + + return new TeamsOperatorConnectNumberConfig( + usage, + choosableCapabilities?.ToList(), + acquiredCapabilities?.ToList(), + availableCapabilities?.ToList(), + additionalUsages?.ToList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// A new instance for mocking. + public static TeamsPhoneMobileNumberConfig TeamsPhoneMobileNumberConfig(string usage = null, IEnumerable choosableCapabilities = null, IEnumerable acquiredCapabilities = null, IEnumerable availableCapabilities = null, IEnumerable additionalUsages = null, string civicAddressId = null, string locationId = null, bool? allowTenantAddressUpdate = null, string displayedCountryCode = null) + { + choosableCapabilities ??= new List(); + acquiredCapabilities ??= new List(); + availableCapabilities ??= new List(); + additionalUsages ??= new List(); + + return new TeamsPhoneMobileNumberConfig( + usage, + choosableCapabilities?.ToList(), + acquiredCapabilities?.ToList(), + availableCapabilities?.ToList(), + additionalUsages?.ToList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// The ID of the Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The name of the account associated with this Request for Information. + /// Will always be 'teams'. + /// The operator ID of the operator consent. + /// The status of the operator consent. + /// The time (ISO8601 format) when the operator consent is created. + /// The time (ISO8601 format) when the operator consent is last modified. + /// The list of consented countries. + /// The list of tenant contacts. + /// The customer relationship of the operator consent. + /// A new instance for mocking. + public static RequestForInformationResource RequestForInformationResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string id = null, string tenantId = null, string accountName = null, string productContext = null, string operatorId = null, TeamsConsentStatus? status = null, DateTimeOffset? consentedOn = null, DateTimeOffset? lastModifiedOn = null, IEnumerable consentedCountries = null, IEnumerable contacts = null, CustomerRelationship customerRelationship = null) + { + serviceProvisioningErrors ??= new List(); + consentedCountries ??= new List(); + contacts ??= new List(); + + return new RequestForInformationResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + id, + tenantId, + accountName, + productContext, + operatorId, + status, + consentedOn, + lastModifiedOn, + consentedCountries?.ToList(), + contacts?.ToList(), + customerRelationship, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The full name of the contact detail. + /// The email of the contact detail. + /// The telephone number of the contact detail. + /// The company name of the contact detail. + /// The company size of the contact detail. + /// A new instance for mocking. + public static ContactDetails ContactDetails(string fullName = null, string email = null, string telephoneNumber = null, string companyName = null, string companySize = null) + { + return new ContactDetails( + fullName, + email, + telephoneNumber, + companyName, + companySize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the customer relationship. + /// The time (ISO8601 format) when the customer relationship is last modified. + /// The comment of the customer relationship. + /// A new instance for mocking. + public static CustomerRelationship CustomerRelationship(string status = null, DateTimeOffset? lastModifiedOn = null, string comment = null) + { + return new CustomerRelationship(status, lastModifiedOn, comment, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Name of the account. + /// A user defined identifier used for correlating with external systems. + /// The details of the account. + /// A new instance for mocking. + public static AccountResource AccountResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string name = null, string correlationId = null, AccountServiceDetails serviceDetails = null) + { + serviceProvisioningErrors ??= new List(); + + return new AccountResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + name, + correlationId, + serviceDetails, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static TeamsOperatorConnectAccountDetails TeamsOperatorConnectAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new TeamsOperatorConnectAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// The configuration for Teams Direct Routing on this account. + /// The provisioning status of the domains. + /// A new instance for mocking. + public static TeamsDirectRoutingAccountDetails TeamsDirectRoutingAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null, TeamsDirectRoutingAccountConfig configuration = null, TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus = default) + { + return new TeamsDirectRoutingAccountDetails( + syncEnabled, + enabled, + numberCount, + configuration, + subdomainStatus, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static TeamsPhoneMobileAccountDetails TeamsPhoneMobileAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new TeamsPhoneMobileAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static ZoomPhoneCloudPeeringAccountDetails ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new ZoomPhoneCloudPeeringAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static AzureOperatorCallProtectionAccountDetails AzureOperatorCallProtectionAccountDetails(bool enabled = default, long? numberCount = null) + { + return new AzureOperatorCallProtectionAccountDetails(enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A list of telephone number upload usages. + /// A new instance for mocking. + public static TeamsCapabilityPlans TeamsCapabilityPlans(IEnumerable capabilityPlans = null) + { + capabilityPlans ??= new List(); + + return new TeamsCapabilityPlans(capabilityPlans?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The capability plan name. + /// The offer types available. + /// The telephone number usage. + /// Mandatory capabilities for telephone numbers. + /// Choosable capabilities for telephone numbers. + /// Boolean indicating if Toll free is supported. + /// A new instance for mocking. + public static TeamsCapabilityPlan TeamsCapabilityPlan(string name = null, IEnumerable offerTypes = null, string usage = null, IEnumerable mandatoryCapabilities = null, IEnumerable choosableCapabilities = null, bool supportsTollFree = default) + { + offerTypes ??= new List(); + mandatoryCapabilities ??= new List(); + choosableCapabilities ??= new List(); + + return new TeamsCapabilityPlan( + name, + offerTypes?.ToList(), + usage, + mandatoryCapabilities?.ToList(), + choosableCapabilities?.ToList(), + supportsTollFree, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. + /// A new instance for mocking. + public static TeamsAvailableCapabilities TeamsAvailableCapabilities(IEnumerable availableCapabilities = null) + { + availableCapabilities ??= new List(); + + return new TeamsAvailableCapabilities(availableCapabilities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the civic address. + /// The country of the civic address. + /// The house number of the civic address. + /// The house number suffix of the civic address. + /// The pre directional of the civic address. + /// The street name of the civic address. + /// The street suffix of the civic address. + /// The post directional of the civic address. + /// The state or province of the civic address. + /// The county or district of the civic address. + /// The city or town of the civic address. + /// The city or town alias of the civic address. + /// The postal or zip code of the civic address. + /// The description of the civic address. + /// The company name of the civic address. + /// The company ID of the civic address. + /// The default location ID of the civic address. + /// The validation status of the civic address. + /// The customer tenant ID of the civic address. + /// The partner ID of the civic address. + /// The list of locations associated with the civic address. + /// The latitude of the civic address. + /// The longitude of the civic address. + /// A new instance for mocking. + public static TeamsCivicAddressResource TeamsCivicAddressResource(string id = null, string country = null, string houseNumber = null, string houseNumberSuffix = null, string preDirectional = null, string streetName = null, string streetSuffix = null, string postDirectional = null, string stateOrProvince = null, string countyOrDistrict = null, string cityOrTown = null, string cityOrTownAlias = null, string postalOrZipCode = null, string description = null, string companyName = null, string companyId = null, string defaultLocationId = null, ValidationStatus? validationStatus = null, string tenantId = null, string partnerId = null, IEnumerable locations = null, string latitude = null, string longitude = null) + { + locations ??= new List(); + + return new TeamsCivicAddressResource( + id, + country, + houseNumber, + houseNumberSuffix, + preDirectional, + streetName, + streetSuffix, + postDirectional, + stateOrProvince, + countyOrDistrict, + cityOrTown, + cityOrTownAlias, + postalOrZipCode, + description, + companyName, + companyId, + defaultLocationId, + validationStatus, + tenantId, + partnerId, + locations?.ToList(), + latitude, + longitude, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the location. + /// The civic address ID of the location. + /// The description of the location. + /// The additional information of the location. + /// Flag indicating whether the location is default or not. + /// The elin (Emergency Location Identification Number) of the location. + /// A new instance for mocking. + public static Location Location(string id = null, string civicAddressId = null, string description = null, string additionalInfo = null, bool? isDefault = null, string elin = null) + { + return new Location( + id, + civicAddressId, + description, + additionalInfo, + isDefault, + elin, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs new file mode 100644 index 000000000000..a19caf1c43e8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CustomSipHeader)) + { + writer.WritePropertyName("customSipHeader"u8); + writer.WriteStringValue(CustomSipHeader); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberConfiguration(document.RootElement, options); + } + + internal static NumberConfiguration DeserializeNumberConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customSipHeader = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSipHeader"u8)) + { + customSipHeader = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberConfiguration(customSipHeader, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NumberConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberConfiguration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs new file mode 100644 index 000000000000..5711b959329c --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Configuration for this number. + public partial class NumberConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NumberConfiguration() + { + } + + /// Initializes a new instance of . + /// Contents of the custom SIP header to use with this number. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. The name of the custom header is set as part of the provisioning platform configuration on Azure Communications Gateway. + /// Keeps track of any properties unknown to the library. + internal NumberConfiguration(string customSipHeader, IDictionary serializedAdditionalRawData) + { + CustomSipHeader = customSipHeader; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Contents of the custom SIP header to use with this number. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. The name of the custom header is set as part of the provisioning platform configuration on Azure Communications Gateway. + public string CustomSipHeader { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs new file mode 100644 index 000000000000..b8d5a613fb2f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberIdentifier : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberIdentifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberIdentifier(document.RootElement, options); + } + + internal static NumberIdentifier DeserializeNumberIdentifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string telephoneNumber = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberIdentifier(telephoneNumber, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support writing '{options.Format}' format."); + } + } + + NumberIdentifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberIdentifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberIdentifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberIdentifier(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs new file mode 100644 index 000000000000..90e20f6dc44b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// An identifier, used to identify a Number resource. + public partial class NumberIdentifier + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// is null. + public NumberIdentifier(string telephoneNumber) + { + Argument.AssertNotNull(telephoneNumber, nameof(telephoneNumber)); + + TelephoneNumber = telephoneNumber; + } + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// Keeps track of any properties unknown to the library. + internal NumberIdentifier(string telephoneNumber, IDictionary serializedAdditionalRawData) + { + TelephoneNumber = telephoneNumber; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberIdentifier() + { + } + + /// Telephone number in E.164 format. + public string TelephoneNumber { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs new file mode 100644 index 000000000000..ba928d4c6155 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberIdentifiers : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberIdentifiers IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberIdentifiers(document.RootElement, options); + } + + internal static NumberIdentifiers DeserializeNumberIdentifiers(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberIdentifier.DeserializeNumberIdentifier(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberIdentifiers(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support writing '{options.Format}' format."); + } + } + + NumberIdentifiers IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberIdentifiers(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberIdentifiers FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberIdentifiers(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs new file mode 100644 index 000000000000..3a161cce2892 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A list identifiers for a Number resource. + public partial class NumberIdentifiers + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array containing a list of identifiers for Number resources. + /// is null. + public NumberIdentifiers(IEnumerable numbers) + { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); + } + + /// Initializes a new instance of . + /// Array containing a list of identifiers for Number resources. + /// Keeps track of any properties unknown to the library. + internal NumberIdentifiers(IList numbers, IDictionary serializedAdditionalRawData) + { + Numbers = numbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberIdentifiers() + { + } + + /// Array containing a list of identifiers for Number resources. + public IList Numbers { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs new file mode 100644 index 000000000000..dd6a5edcca85 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + writer.WritePropertyName("serviceDetails"u8); + writer.WriteObjectValue(ServiceDetails, options); + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberResource(document.RootElement, options); + } + + internal static NumberResource DeserializeNumberResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string telephoneNumber = default; + string accountName = default; + NumberServiceDetails serviceDetails = default; + NumberConfiguration configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceDetails"u8)) + { + serviceDetails = NumberServiceDetails.DeserializeNumberServiceDetails(property.Value, options); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = NumberConfiguration.DeserializeNumberConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + telephoneNumber, + accountName, + serviceDetails, + configuration, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberResource)} does not support writing '{options.Format}' format."); + } + } + + NumberResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs new file mode 100644 index 000000000000..ff23d578e442 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The configuration for a telephone number provisioned in Azure Communications Gateway. + public partial class NumberResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// , or is null. + public NumberResource(string telephoneNumber, string accountName, NumberServiceDetails serviceDetails) + { + Argument.AssertNotNull(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(accountName, nameof(accountName)); + Argument.AssertNotNull(serviceDetails, nameof(serviceDetails)); + + ServiceProvisioningErrors = new ChangeTrackingList(); + TelephoneNumber = telephoneNumber; + AccountName = accountName; + ServiceDetails = serviceDetails; + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// Configuration for this number. + /// Keeps track of any properties unknown to the library. + internal NumberResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string telephoneNumber, string accountName, NumberServiceDetails serviceDetails, NumberConfiguration configuration, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + TelephoneNumber = telephoneNumber; + AccountName = accountName; + ServiceDetails = serviceDetails; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberResource() + { + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// Telephone number in E.164 format. + public string TelephoneNumber { get; set; } + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + public string AccountName { get; set; } + /// Configuration of the individual backend services for this number. + public NumberServiceDetails ServiceDetails { get; set; } + /// Configuration for this number. + public NumberConfiguration Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs new file mode 100644 index 000000000000..a8dc6c7732f5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberServiceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TeamsOperatorConnect)) + { + writer.WritePropertyName("teamsOperatorConnect"u8); + writer.WriteObjectValue(TeamsOperatorConnect, options); + } + if (Optional.IsDefined(TeamsDirectRouting)) + { + writer.WritePropertyName("teamsDirectRouting"u8); + writer.WriteObjectValue(TeamsDirectRouting, options); + } + if (Optional.IsDefined(TeamsPhoneMobile)) + { + writer.WritePropertyName("teamsPhoneMobile"u8); + writer.WriteObjectValue(TeamsPhoneMobile, options); + } + if (Optional.IsDefined(ZoomPhoneCloudPeering)) + { + writer.WritePropertyName("zoomPhoneCloudPeering"u8); + writer.WriteObjectValue(ZoomPhoneCloudPeering, options); + } + if (Optional.IsDefined(AzureOperatorCallProtection)) + { + writer.WritePropertyName("azureOperatorCallProtection"u8); + writer.WriteObjectValue(AzureOperatorCallProtection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberServiceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberServiceDetails(document.RootElement, options); + } + + internal static NumberServiceDetails DeserializeNumberServiceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TeamsOperatorConnectNumberDetails teamsOperatorConnect = default; + TeamsDirectRoutingNumberDetails teamsDirectRouting = default; + TeamsPhoneMobileNumberDetails teamsPhoneMobile = default; + ZoomPhoneCloudPeeringNumberDetails zoomPhoneCloudPeering = default; + AzureOperatorCallProtectionNumberDetails azureOperatorCallProtection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("teamsOperatorConnect"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsOperatorConnect = TeamsOperatorConnectNumberDetails.DeserializeTeamsOperatorConnectNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsDirectRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsDirectRouting = TeamsDirectRoutingNumberDetails.DeserializeTeamsDirectRoutingNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsPhoneMobile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsPhoneMobile = TeamsPhoneMobileNumberDetails.DeserializeTeamsPhoneMobileNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("zoomPhoneCloudPeering"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoomPhoneCloudPeering = ZoomPhoneCloudPeeringNumberDetails.DeserializeZoomPhoneCloudPeeringNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("azureOperatorCallProtection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOperatorCallProtection = AzureOperatorCallProtectionNumberDetails.DeserializeAzureOperatorCallProtectionNumberDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberServiceDetails( + teamsOperatorConnect, + teamsDirectRouting, + teamsPhoneMobile, + zoomPhoneCloudPeering, + azureOperatorCallProtection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support writing '{options.Format}' format."); + } + } + + NumberServiceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberServiceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberServiceDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberServiceDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs new file mode 100644 index 000000000000..888147b1e60e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Configuration of backend services for a telephone number. + public partial class NumberServiceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NumberServiceDetails() + { + } + + /// Initializes a new instance of . + /// Details for the Teams Operator Connect service on this Number. + /// Details for the Teams Direct Routing service on this Number. + /// Details for the Teams Phone Mobile service on this Number. + /// Details for the Zoom Phone Cloud Peering service on this Number. + /// Details for the Azure Operator Call Protection service on this Number. + /// Keeps track of any properties unknown to the library. + internal NumberServiceDetails(TeamsOperatorConnectNumberDetails teamsOperatorConnect, TeamsDirectRoutingNumberDetails teamsDirectRouting, TeamsPhoneMobileNumberDetails teamsPhoneMobile, ZoomPhoneCloudPeeringNumberDetails zoomPhoneCloudPeering, AzureOperatorCallProtectionNumberDetails azureOperatorCallProtection, IDictionary serializedAdditionalRawData) + { + TeamsOperatorConnect = teamsOperatorConnect; + TeamsDirectRouting = teamsDirectRouting; + TeamsPhoneMobile = teamsPhoneMobile; + ZoomPhoneCloudPeering = zoomPhoneCloudPeering; + AzureOperatorCallProtection = azureOperatorCallProtection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Details for the Teams Operator Connect service on this Number. + public TeamsOperatorConnectNumberDetails TeamsOperatorConnect { get; set; } + /// Details for the Teams Direct Routing service on this Number. + public TeamsDirectRoutingNumberDetails TeamsDirectRouting { get; set; } + /// Details for the Teams Phone Mobile service on this Number. + public TeamsPhoneMobileNumberDetails TeamsPhoneMobile { get; set; } + /// Details for the Zoom Phone Cloud Peering service on this Number. + public ZoomPhoneCloudPeeringNumberDetails ZoomPhoneCloudPeering { get; set; } + /// Details for the Azure Operator Call Protection service on this Number. + public AzureOperatorCallProtectionNumberDetails AzureOperatorCallProtection { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.Serialization.cs new file mode 100644 index 000000000000..4037cf983ac1 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class PagedNumberList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PagedNumberList)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PagedNumberList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PagedNumberList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePagedNumberList(document.RootElement, options); + } + + internal static PagedNumberList DeserializePagedNumberList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberResource.DeserializeNumberResource(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PagedNumberList(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PagedNumberList)} does not support writing '{options.Format}' format."); + } + } + + PagedNumberList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePagedNumberList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PagedNumberList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PagedNumberList FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePagedNumberList(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.cs new file mode 100644 index 000000000000..e75e4f548dc3 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/PagedNumberList.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Paged collection of NumberResource items. + public partial class PagedNumberList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NumberResource items on this page. + /// is null. + internal PagedNumberList(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NumberResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PagedNumberList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PagedNumberList() + { + } + + /// The NumberResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs new file mode 100644 index 000000000000..2e5b3b7537f6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class RequestForInformationResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (options.Format != "W" && Optional.IsDefined(AccountName)) + { + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + } + if (options.Format != "W" && Optional.IsDefined(ProductContext)) + { + writer.WritePropertyName("productContext"u8); + writer.WriteStringValue(ProductContext); + } + if (options.Format != "W" && Optional.IsDefined(OperatorId)) + { + writer.WritePropertyName("operatorId"u8); + writer.WriteStringValue(OperatorId); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConsentedOn)) + { + writer.WritePropertyName("consentedOn"u8); + writer.WriteStringValue(ConsentedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastModifiedOn)) + { + writer.WritePropertyName("lastModifiedOn"u8); + writer.WriteStringValue(LastModifiedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ConsentedCountries)) + { + writer.WritePropertyName("consentedCountries"u8); + writer.WriteStartArray(); + foreach (var item in ConsentedCountries) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Contacts)) + { + writer.WritePropertyName("contacts"u8); + writer.WriteStartArray(); + foreach (var item in Contacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CustomerRelationship)) + { + writer.WritePropertyName("customerRelationship"u8); + writer.WriteObjectValue(CustomerRelationship, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RequestForInformationResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRequestForInformationResource(document.RootElement, options); + } + + internal static RequestForInformationResource DeserializeRequestForInformationResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string id = default; + string tenantId = default; + string accountName = default; + string productContext = default; + string operatorId = default; + TeamsConsentStatus? status = default; + DateTimeOffset? consentedOn = default; + DateTimeOffset? lastModifiedOn = default; + IReadOnlyList consentedCountries = default; + IReadOnlyList contacts = default; + CustomerRelationship customerRelationship = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("productContext"u8)) + { + productContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatorId"u8)) + { + operatorId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new TeamsConsentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("consentedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consentedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("consentedCountries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + consentedCountries = array; + continue; + } + if (property.NameEquals("contacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContactDetails.DeserializeContactDetails(item, options)); + } + contacts = array; + continue; + } + if (property.NameEquals("customerRelationship"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerRelationship = CustomerRelationship.DeserializeCustomerRelationship(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RequestForInformationResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + id, + tenantId, + accountName, + productContext, + operatorId, + status, + consentedOn, + lastModifiedOn, + consentedCountries ?? new ChangeTrackingList(), + contacts ?? new ChangeTrackingList(), + customerRelationship, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support writing '{options.Format}' format."); + } + } + + RequestForInformationResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRequestForInformationResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RequestForInformationResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRequestForInformationResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs new file mode 100644 index 000000000000..804e8d1e426d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The configuration for a telephone number provisioned in ACG. + public partial class RequestForInformationResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RequestForInformationResource() + { + ServiceProvisioningErrors = new ChangeTrackingList(); + ConsentedCountries = new ChangeTrackingList(); + Contacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// The ID of the Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The name of the account associated with this Request for Information. + /// Will always be 'teams'. + /// The operator ID of the operator consent. + /// The status of the operator consent. + /// The time (ISO8601 format) when the operator consent is created. + /// The time (ISO8601 format) when the operator consent is last modified. + /// The list of consented countries. + /// The list of tenant contacts. + /// The customer relationship of the operator consent. + /// Keeps track of any properties unknown to the library. + internal RequestForInformationResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string id, string tenantId, string accountName, string productContext, string operatorId, TeamsConsentStatus? status, DateTimeOffset? consentedOn, DateTimeOffset? lastModifiedOn, IReadOnlyList consentedCountries, IReadOnlyList contacts, CustomerRelationship customerRelationship, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + Id = id; + TenantId = tenantId; + AccountName = accountName; + ProductContext = productContext; + OperatorId = operatorId; + Status = status; + ConsentedOn = consentedOn; + LastModifiedOn = lastModifiedOn; + ConsentedCountries = consentedCountries; + Contacts = contacts; + CustomerRelationship = customerRelationship; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// The ID of the Request for Information. + public string Id { get; } + /// The Teams tenant ID which generated this Request for Information. + public string TenantId { get; } + /// The name of the account associated with this Request for Information. + public string AccountName { get; } + /// Will always be 'teams'. + public string ProductContext { get; } + /// The operator ID of the operator consent. + public string OperatorId { get; } + /// The status of the operator consent. + public TeamsConsentStatus? Status { get; } + /// The time (ISO8601 format) when the operator consent is created. + public DateTimeOffset? ConsentedOn { get; } + /// The time (ISO8601 format) when the operator consent is last modified. + public DateTimeOffset? LastModifiedOn { get; } + /// The list of consented countries. + public IReadOnlyList ConsentedCountries { get; } + /// The list of tenant contacts. + public IReadOnlyList Contacts { get; } + /// The customer relationship of the operator consent. + public CustomerRelationship CustomerRelationship { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs new file mode 100644 index 000000000000..96c27709f6b5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The provisioning states of an object on any relevant backend service. + public readonly partial struct ServiceProvisioningStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceProvisioningStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "pending"; + private const string SyncedValue = "synced"; + private const string FailedValue = "failed"; + + /// The object is pending provisioning. + public static ServiceProvisioningStatus Pending { get; } = new ServiceProvisioningStatus(PendingValue); + /// The object has been synced with the relevant backend service. + public static ServiceProvisioningStatus Synced { get; } = new ServiceProvisioningStatus(SyncedValue); + /// The object provisioning operation failed with the relevant backend service. + public static ServiceProvisioningStatus Failed { get; } = new ServiceProvisioningStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ServiceProvisioningStatus left, ServiceProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceProvisioningStatus left, ServiceProvisioningStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceProvisioningStatus(string value) => new ServiceProvisioningStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceProvisioningStatus other && Equals(other); + /// + public bool Equals(ServiceProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs new file mode 100644 index 000000000000..e12d209f08fd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsAvailableCapabilities : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsAvailableCapabilities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsAvailableCapabilities(document.RootElement, options); + } + + internal static TeamsAvailableCapabilities DeserializeTeamsAvailableCapabilities(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList availableCapabilities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availableCapabilities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsAvailableCapabilities(availableCapabilities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support writing '{options.Format}' format."); + } + } + + TeamsAvailableCapabilities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsAvailableCapabilities(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsAvailableCapabilities FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsAvailableCapabilities(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs new file mode 100644 index 000000000000..1efbe9849568 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The Teams capabilities available for numbers with Operator Connect or Teams Phone Mobile services enabled. + public partial class TeamsAvailableCapabilities + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsAvailableCapabilities() + { + AvailableCapabilities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. + /// Keeps track of any properties unknown to the library. + internal TeamsAvailableCapabilities(IReadOnlyList availableCapabilities, IDictionary serializedAdditionalRawData) + { + AvailableCapabilities = availableCapabilities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. + public IReadOnlyList AvailableCapabilities { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs new file mode 100644 index 000000000000..a094695b5400 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCapabilityPlan : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsCollectionDefined(OfferTypes)) + { + writer.WritePropertyName("offerTypes"u8); + writer.WriteStartArray(); + foreach (var item in OfferTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W") + { + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MandatoryCapabilities)) + { + writer.WritePropertyName("mandatoryCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in MandatoryCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ChoosableCapabilities)) + { + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W") + { + writer.WritePropertyName("supportsTollFree"u8); + writer.WriteBooleanValue(SupportsTollFree); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCapabilityPlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCapabilityPlan(document.RootElement, options); + } + + internal static TeamsCapabilityPlan DeserializeTeamsCapabilityPlan(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IReadOnlyList offerTypes = default; + string usage = default; + IReadOnlyList mandatoryCapabilities = default; + IReadOnlyList choosableCapabilities = default; + bool supportsTollFree = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + offerTypes = array; + continue; + } + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("mandatoryCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mandatoryCapabilities = array; + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("supportsTollFree"u8)) + { + supportsTollFree = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCapabilityPlan( + name, + offerTypes ?? new ChangeTrackingList(), + usage, + mandatoryCapabilities ?? new ChangeTrackingList(), + choosableCapabilities ?? new ChangeTrackingList(), + supportsTollFree, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support writing '{options.Format}' format."); + } + } + + TeamsCapabilityPlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCapabilityPlan(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCapabilityPlan FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCapabilityPlan(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs new file mode 100644 index 000000000000..daa8b4f3ecfd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A teams capability plan for a given usage. + public partial class TeamsCapabilityPlan + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsCapabilityPlan() + { + OfferTypes = new ChangeTrackingList(); + MandatoryCapabilities = new ChangeTrackingList(); + ChoosableCapabilities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The capability plan name. + /// The offer types available. + /// The telephone number usage. + /// Mandatory capabilities for telephone numbers. + /// Choosable capabilities for telephone numbers. + /// Boolean indicating if Toll free is supported. + /// Keeps track of any properties unknown to the library. + internal TeamsCapabilityPlan(string name, IReadOnlyList offerTypes, string usage, IReadOnlyList mandatoryCapabilities, IReadOnlyList choosableCapabilities, bool supportsTollFree, IDictionary serializedAdditionalRawData) + { + Name = name; + OfferTypes = offerTypes; + Usage = usage; + MandatoryCapabilities = mandatoryCapabilities; + ChoosableCapabilities = choosableCapabilities; + SupportsTollFree = supportsTollFree; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The capability plan name. + public string Name { get; } + /// The offer types available. + public IReadOnlyList OfferTypes { get; } + /// The telephone number usage. + public string Usage { get; } + /// Mandatory capabilities for telephone numbers. + public IReadOnlyList MandatoryCapabilities { get; } + /// Choosable capabilities for telephone numbers. + public IReadOnlyList ChoosableCapabilities { get; } + /// Boolean indicating if Toll free is supported. + public bool SupportsTollFree { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs new file mode 100644 index 000000000000..24e5f6d15ded --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCapabilityPlans : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("capabilityPlans"u8); + writer.WriteStartArray(); + foreach (var item in CapabilityPlans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCapabilityPlans IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCapabilityPlans(document.RootElement, options); + } + + internal static TeamsCapabilityPlans DeserializeTeamsCapabilityPlans(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList capabilityPlans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capabilityPlans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TeamsCapabilityPlan.DeserializeTeamsCapabilityPlan(item, options)); + } + capabilityPlans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCapabilityPlans(capabilityPlans, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support writing '{options.Format}' format."); + } + } + + TeamsCapabilityPlans IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCapabilityPlans(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCapabilityPlans FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCapabilityPlans(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs new file mode 100644 index 000000000000..ed8ec02e8a47 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The Teams telephone number upload usages for this account. + public partial class TeamsCapabilityPlans + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsCapabilityPlans() + { + CapabilityPlans = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// A list of telephone number upload usages. + /// Keeps track of any properties unknown to the library. + internal TeamsCapabilityPlans(IReadOnlyList capabilityPlans, IDictionary serializedAdditionalRawData) + { + CapabilityPlans = capabilityPlans; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A list of telephone number upload usages. + public IReadOnlyList CapabilityPlans { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs new file mode 100644 index 000000000000..2efc8a4cb3e2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCivicAddressResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Country)) + { + writer.WritePropertyName("country"u8); + writer.WriteStringValue(Country); + } + if (options.Format != "W" && Optional.IsDefined(HouseNumber)) + { + writer.WritePropertyName("houseNumber"u8); + writer.WriteStringValue(HouseNumber); + } + if (options.Format != "W" && Optional.IsDefined(HouseNumberSuffix)) + { + writer.WritePropertyName("houseNumberSuffix"u8); + writer.WriteStringValue(HouseNumberSuffix); + } + if (options.Format != "W" && Optional.IsDefined(PreDirectional)) + { + writer.WritePropertyName("preDirectional"u8); + writer.WriteStringValue(PreDirectional); + } + if (options.Format != "W" && Optional.IsDefined(StreetName)) + { + writer.WritePropertyName("streetName"u8); + writer.WriteStringValue(StreetName); + } + if (options.Format != "W" && Optional.IsDefined(StreetSuffix)) + { + writer.WritePropertyName("streetSuffix"u8); + writer.WriteStringValue(StreetSuffix); + } + if (options.Format != "W" && Optional.IsDefined(PostDirectional)) + { + writer.WritePropertyName("postDirectional"u8); + writer.WriteStringValue(PostDirectional); + } + if (options.Format != "W" && Optional.IsDefined(StateOrProvince)) + { + writer.WritePropertyName("stateOrProvince"u8); + writer.WriteStringValue(StateOrProvince); + } + if (options.Format != "W" && Optional.IsDefined(CountyOrDistrict)) + { + writer.WritePropertyName("countyOrDistrict"u8); + writer.WriteStringValue(CountyOrDistrict); + } + if (options.Format != "W" && Optional.IsDefined(CityOrTown)) + { + writer.WritePropertyName("cityOrTown"u8); + writer.WriteStringValue(CityOrTown); + } + if (options.Format != "W" && Optional.IsDefined(CityOrTownAlias)) + { + writer.WritePropertyName("cityOrTownAlias"u8); + writer.WriteStringValue(CityOrTownAlias); + } + if (options.Format != "W" && Optional.IsDefined(PostalOrZipCode)) + { + writer.WritePropertyName("postalOrZipCode"u8); + writer.WriteStringValue(PostalOrZipCode); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CompanyName)) + { + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + } + if (options.Format != "W" && Optional.IsDefined(CompanyId)) + { + writer.WritePropertyName("companyId"u8); + writer.WriteStringValue(CompanyId); + } + if (options.Format != "W") + { + writer.WritePropertyName("defaultLocationId"u8); + writer.WriteStringValue(DefaultLocationId); + } + if (options.Format != "W" && Optional.IsDefined(ValidationStatus)) + { + writer.WritePropertyName("validationStatus"u8); + writer.WriteStringValue(ValidationStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (options.Format != "W" && Optional.IsDefined(PartnerId)) + { + writer.WritePropertyName("partnerId"u8); + writer.WriteStringValue(PartnerId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Locations)) + { + writer.WritePropertyName("locations"u8); + writer.WriteStartArray(); + foreach (var item in Locations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Latitude)) + { + writer.WritePropertyName("latitude"u8); + writer.WriteStringValue(Latitude); + } + if (options.Format != "W" && Optional.IsDefined(Longitude)) + { + writer.WritePropertyName("longitude"u8); + writer.WriteStringValue(Longitude); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCivicAddressResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCivicAddressResource(document.RootElement, options); + } + + internal static TeamsCivicAddressResource DeserializeTeamsCivicAddressResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string country = default; + string houseNumber = default; + string houseNumberSuffix = default; + string preDirectional = default; + string streetName = default; + string streetSuffix = default; + string postDirectional = default; + string stateOrProvince = default; + string countyOrDistrict = default; + string cityOrTown = default; + string cityOrTownAlias = default; + string postalOrZipCode = default; + string description = default; + string companyName = default; + string companyId = default; + string defaultLocationId = default; + ValidationStatus? validationStatus = default; + string tenantId = default; + string partnerId = default; + IReadOnlyList locations = default; + string latitude = default; + string longitude = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("country"u8)) + { + country = property.Value.GetString(); + continue; + } + if (property.NameEquals("houseNumber"u8)) + { + houseNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("houseNumberSuffix"u8)) + { + houseNumberSuffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("preDirectional"u8)) + { + preDirectional = property.Value.GetString(); + continue; + } + if (property.NameEquals("streetName"u8)) + { + streetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("streetSuffix"u8)) + { + streetSuffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("postDirectional"u8)) + { + postDirectional = property.Value.GetString(); + continue; + } + if (property.NameEquals("stateOrProvince"u8)) + { + stateOrProvince = property.Value.GetString(); + continue; + } + if (property.NameEquals("countyOrDistrict"u8)) + { + countyOrDistrict = property.Value.GetString(); + continue; + } + if (property.NameEquals("cityOrTown"u8)) + { + cityOrTown = property.Value.GetString(); + continue; + } + if (property.NameEquals("cityOrTownAlias"u8)) + { + cityOrTownAlias = property.Value.GetString(); + continue; + } + if (property.NameEquals("postalOrZipCode"u8)) + { + postalOrZipCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyName"u8)) + { + companyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyId"u8)) + { + companyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultLocationId"u8)) + { + defaultLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("validationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationStatus = new ValidationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerId"u8)) + { + partnerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Location.DeserializeLocation(item, options)); + } + locations = array; + continue; + } + if (property.NameEquals("latitude"u8)) + { + latitude = property.Value.GetString(); + continue; + } + if (property.NameEquals("longitude"u8)) + { + longitude = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCivicAddressResource( + id, + country, + houseNumber, + houseNumberSuffix, + preDirectional, + streetName, + streetSuffix, + postDirectional, + stateOrProvince, + countyOrDistrict, + cityOrTown, + cityOrTownAlias, + postalOrZipCode, + description, + companyName, + companyId, + defaultLocationId, + validationStatus, + tenantId, + partnerId, + locations ?? new ChangeTrackingList(), + latitude, + longitude, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support writing '{options.Format}' format."); + } + } + + TeamsCivicAddressResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCivicAddressResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCivicAddressResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCivicAddressResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs new file mode 100644 index 000000000000..b6b0b5d0f462 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A civic address available for Teams Operator Connect or Teams Phone Mobile users. + public partial class TeamsCivicAddressResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsCivicAddressResource() + { + Locations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The ID of the civic address. + /// The country of the civic address. + /// The house number of the civic address. + /// The house number suffix of the civic address. + /// The pre directional of the civic address. + /// The street name of the civic address. + /// The street suffix of the civic address. + /// The post directional of the civic address. + /// The state or province of the civic address. + /// The county or district of the civic address. + /// The city or town of the civic address. + /// The city or town alias of the civic address. + /// The postal or zip code of the civic address. + /// The description of the civic address. + /// The company name of the civic address. + /// The company ID of the civic address. + /// The default location ID of the civic address. + /// The validation status of the civic address. + /// The customer tenant ID of the civic address. + /// The partner ID of the civic address. + /// The list of locations associated with the civic address. + /// The latitude of the civic address. + /// The longitude of the civic address. + /// Keeps track of any properties unknown to the library. + internal TeamsCivicAddressResource(string id, string country, string houseNumber, string houseNumberSuffix, string preDirectional, string streetName, string streetSuffix, string postDirectional, string stateOrProvince, string countyOrDistrict, string cityOrTown, string cityOrTownAlias, string postalOrZipCode, string description, string companyName, string companyId, string defaultLocationId, ValidationStatus? validationStatus, string tenantId, string partnerId, IReadOnlyList locations, string latitude, string longitude, IDictionary serializedAdditionalRawData) + { + Id = id; + Country = country; + HouseNumber = houseNumber; + HouseNumberSuffix = houseNumberSuffix; + PreDirectional = preDirectional; + StreetName = streetName; + StreetSuffix = streetSuffix; + PostDirectional = postDirectional; + StateOrProvince = stateOrProvince; + CountyOrDistrict = countyOrDistrict; + CityOrTown = cityOrTown; + CityOrTownAlias = cityOrTownAlias; + PostalOrZipCode = postalOrZipCode; + Description = description; + CompanyName = companyName; + CompanyId = companyId; + DefaultLocationId = defaultLocationId; + ValidationStatus = validationStatus; + TenantId = tenantId; + PartnerId = partnerId; + Locations = locations; + Latitude = latitude; + Longitude = longitude; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the civic address. + public string Id { get; } + /// The country of the civic address. + public string Country { get; } + /// The house number of the civic address. + public string HouseNumber { get; } + /// The house number suffix of the civic address. + public string HouseNumberSuffix { get; } + /// The pre directional of the civic address. + public string PreDirectional { get; } + /// The street name of the civic address. + public string StreetName { get; } + /// The street suffix of the civic address. + public string StreetSuffix { get; } + /// The post directional of the civic address. + public string PostDirectional { get; } + /// The state or province of the civic address. + public string StateOrProvince { get; } + /// The county or district of the civic address. + public string CountyOrDistrict { get; } + /// The city or town of the civic address. + public string CityOrTown { get; } + /// The city or town alias of the civic address. + public string CityOrTownAlias { get; } + /// The postal or zip code of the civic address. + public string PostalOrZipCode { get; } + /// The description of the civic address. + public string Description { get; } + /// The company name of the civic address. + public string CompanyName { get; } + /// The company ID of the civic address. + public string CompanyId { get; } + /// The default location ID of the civic address. + public string DefaultLocationId { get; } + /// The validation status of the civic address. + public ValidationStatus? ValidationStatus { get; } + /// The customer tenant ID of the civic address. + public string TenantId { get; } + /// The partner ID of the civic address. + public string PartnerId { get; } + /// The list of locations associated with the civic address. + public IReadOnlyList Locations { get; } + /// The latitude of the civic address. + public string Latitude { get; } + /// The longitude of the civic address. + public string Longitude { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs new file mode 100644 index 000000000000..65f9be74adfd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The possible state for an Operator Consent. + public readonly partial struct TeamsConsentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TeamsConsentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "active"; + private const string SuspendedValue = "suspended"; + private const string RemovedValue = "removed"; + + /// The Operator Consent is active. + public static TeamsConsentStatus Active { get; } = new TeamsConsentStatus(ActiveValue); + /// The Operator Consent is suspended. + public static TeamsConsentStatus Suspended { get; } = new TeamsConsentStatus(SuspendedValue); + /// The Operator Consent is removed. + public static TeamsConsentStatus Removed { get; } = new TeamsConsentStatus(RemovedValue); + /// Determines if two values are the same. + public static bool operator ==(TeamsConsentStatus left, TeamsConsentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TeamsConsentStatus left, TeamsConsentStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TeamsConsentStatus(string value) => new TeamsConsentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TeamsConsentStatus other && Equals(other); + /// + public bool Equals(TeamsConsentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs new file mode 100644 index 000000000000..f21cec989086 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingAccountConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("callScreening"u8); + writer.WriteBooleanValue(CallScreening); + writer.WritePropertyName("subdomain"u8); + writer.WriteStringValue(Subdomain); + writer.WritePropertyName("subdomainTokens"u8); + writer.WriteObjectValue(SubdomainTokens, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingAccountConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement, options); + } + + internal static TeamsDirectRoutingAccountConfig DeserializeTeamsDirectRoutingAccountConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool callScreening = default; + string subdomain = default; + TeamsDirectRoutingSubdomainTokens subdomainTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("callScreening"u8)) + { + callScreening = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("subdomain"u8)) + { + subdomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("subdomainTokens"u8)) + { + subdomainTokens = TeamsDirectRoutingSubdomainTokens.DeserializeTeamsDirectRoutingSubdomainTokens(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingAccountConfig(callScreening, subdomain, subdomainTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingAccountConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingAccountConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs new file mode 100644 index 000000000000..d074b9e7b99d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Configuration specific to Teams Direct Routing. + public partial class TeamsDirectRoutingAccountConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + /// or is null. + public TeamsDirectRoutingAccountConfig(bool callScreening, string subdomain, TeamsDirectRoutingSubdomainTokens subdomainTokens) + { + Argument.AssertNotNull(subdomain, nameof(subdomain)); + Argument.AssertNotNull(subdomainTokens, nameof(subdomainTokens)); + + CallScreening = callScreening; + Subdomain = subdomain; + SubdomainTokens = subdomainTokens; + } + + /// Initializes a new instance of . + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingAccountConfig(bool callScreening, string subdomain, TeamsDirectRoutingSubdomainTokens subdomainTokens, IDictionary serializedAdditionalRawData) + { + CallScreening = callScreening; + Subdomain = subdomain; + SubdomainTokens = subdomainTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingAccountConfig() + { + } + + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + public bool CallScreening { get; set; } + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + public string Subdomain { get; set; } + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + public TeamsDirectRoutingSubdomainTokens SubdomainTokens { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs new file mode 100644 index 000000000000..aa1a05cfc620 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("subdomainStatus"u8); + writer.WriteStringValue(SubdomainStatus.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement, options); + } + + internal static TeamsDirectRoutingAccountDetails DeserializeTeamsDirectRoutingAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + TeamsDirectRoutingAccountConfig configuration = default; + TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsDirectRoutingAccountConfig.DeserializeTeamsDirectRoutingAccountConfig(property.Value, options); + continue; + } + if (property.NameEquals("subdomainStatus"u8)) + { + subdomainStatus = new TeamsDirectRoutingSubdomainProvisioningStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingAccountDetails( + syncEnabled, + enabled, + numberCount, + configuration, + subdomainStatus, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs new file mode 100644 index 000000000000..b9fef8134b2f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Direct Routing on this Account. + public partial class TeamsDirectRoutingAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsDirectRoutingAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// The configuration for Teams Direct Routing on this account. + /// The provisioning status of the domains. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingAccountDetails(bool syncEnabled, bool enabled, long? numberCount, TeamsDirectRoutingAccountConfig configuration, TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + Configuration = configuration; + SubdomainStatus = subdomainStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + /// The configuration for Teams Direct Routing on this account. + public TeamsDirectRoutingAccountConfig Configuration { get; set; } + /// The provisioning status of the domains. + public TeamsDirectRoutingSubdomainProvisioningStatus SubdomainStatus { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs new file mode 100644 index 000000000000..b752877c8de7 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement, options); + } + + internal static TeamsDirectRoutingNumberDetails DeserializeTeamsDirectRoutingNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs new file mode 100644 index 000000000000..ebc68a7a354d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Teams Direct Routing service on this Number. + public partial class TeamsDirectRoutingNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsDirectRoutingNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs new file mode 100644 index 000000000000..3225f46f4644 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Possible values for DNS provisioning state of Teams Direct Routing domains. + public readonly partial struct TeamsDirectRoutingSubdomainProvisioningStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TeamsDirectRoutingSubdomainProvisioningStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisionedValue = "provisioned"; + private const string NotProvisionedValue = "notProvisioned"; + private const string InconsistentValue = "inconsistent"; + + /// The DNS provisioning state Provisioned. + public static TeamsDirectRoutingSubdomainProvisioningStatus Provisioned { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(ProvisionedValue); + /// The DNS provisioning state Not Provisioned. + public static TeamsDirectRoutingSubdomainProvisioningStatus NotProvisioned { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(NotProvisionedValue); + /// The DNS provisioning state Inconsistent. + public static TeamsDirectRoutingSubdomainProvisioningStatus Inconsistent { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(InconsistentValue); + /// Determines if two values are the same. + public static bool operator ==(TeamsDirectRoutingSubdomainProvisioningStatus left, TeamsDirectRoutingSubdomainProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TeamsDirectRoutingSubdomainProvisioningStatus left, TeamsDirectRoutingSubdomainProvisioningStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TeamsDirectRoutingSubdomainProvisioningStatus(string value) => new TeamsDirectRoutingSubdomainProvisioningStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TeamsDirectRoutingSubdomainProvisioningStatus other && Equals(other); + /// + public bool Equals(TeamsDirectRoutingSubdomainProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs new file mode 100644 index 000000000000..f2494a1a0c8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingSubdomainTokens : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("region1Token"u8); + writer.WriteStringValue(Region1Token); + writer.WritePropertyName("region2Token"u8); + writer.WriteStringValue(Region2Token); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingSubdomainTokens IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement, options); + } + + internal static TeamsDirectRoutingSubdomainTokens DeserializeTeamsDirectRoutingSubdomainTokens(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string region1Token = default; + string region2Token = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("region1Token"u8)) + { + region1Token = property.Value.GetString(); + continue; + } + if (property.NameEquals("region2Token"u8)) + { + region2Token = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingSubdomainTokens(region1Token, region2Token, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingSubdomainTokens IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingSubdomainTokens FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs new file mode 100644 index 000000000000..b2f2b78bd2a2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// DNS TXT value for the region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public partial class TeamsDirectRoutingSubdomainTokens + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// or is null. + public TeamsDirectRoutingSubdomainTokens(string region1Token, string region2Token) + { + Argument.AssertNotNull(region1Token, nameof(region1Token)); + Argument.AssertNotNull(region2Token, nameof(region2Token)); + + Region1Token = region1Token; + Region2Token = region2Token; + } + + /// Initializes a new instance of . + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingSubdomainTokens(string region1Token, string region2Token, IDictionary serializedAdditionalRawData) + { + Region1Token = region1Token; + Region2Token = region2Token; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingSubdomainTokens() + { + } + + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public string Region1Token { get; set; } + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public string Region2Token { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs new file mode 100644 index 000000000000..8072155055e8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement, options); + } + + internal static TeamsOperatorConnectAccountDetails DeserializeTeamsOperatorConnectAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs new file mode 100644 index 000000000000..b367f1505d8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Operator Connect on this Account. + public partial class TeamsOperatorConnectAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsOperatorConnectAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs new file mode 100644 index 000000000000..1f4dafd48895 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectNumberConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(AcquiredCapabilities)) + { + writer.WritePropertyName("acquiredCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AcquiredCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AvailableCapabilities)) + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AdditionalUsages)) + { + writer.WritePropertyName("additionalUsages"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUsages) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CivicAddressId)) + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (Optional.IsDefined(LocationId)) + { + writer.WritePropertyName("locationId"u8); + writer.WriteStringValue(LocationId); + } + if (Optional.IsDefined(AllowTenantAddressUpdate)) + { + writer.WritePropertyName("allowTenantAddressUpdate"u8); + writer.WriteBooleanValue(AllowTenantAddressUpdate.Value); + } + if (Optional.IsDefined(DisplayedCountryCode)) + { + writer.WritePropertyName("displayedCountryCode"u8); + writer.WriteStringValue(DisplayedCountryCode); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectNumberConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement, options); + } + + internal static TeamsOperatorConnectNumberConfig DeserializeTeamsOperatorConnectNumberConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string usage = default; + IList choosableCapabilities = default; + IReadOnlyList acquiredCapabilities = default; + IReadOnlyList availableCapabilities = default; + IList additionalUsages = default; + string civicAddressId = default; + string locationId = default; + bool? allowTenantAddressUpdate = default; + string displayedCountryCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("acquiredCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + acquiredCapabilities = array; + continue; + } + if (property.NameEquals("availableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; + continue; + } + if (property.NameEquals("additionalUsages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + additionalUsages = array; + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locationId"u8)) + { + locationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowTenantAddressUpdate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTenantAddressUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayedCountryCode"u8)) + { + displayedCountryCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectNumberConfig( + usage, + choosableCapabilities, + acquiredCapabilities ?? new ChangeTrackingList(), + availableCapabilities ?? new ChangeTrackingList(), + additionalUsages ?? new ChangeTrackingList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectNumberConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectNumberConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs new file mode 100644 index 000000000000..5029e46ddeea --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Telephone number configuration for Teams Operator Connect telephone numbers. + public partial class TeamsOperatorConnectNumberConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// or is null. + public TeamsOperatorConnectNumberConfig(string usage, IEnumerable choosableCapabilities) + { + Argument.AssertNotNull(usage, nameof(usage)); + Argument.AssertNotNull(choosableCapabilities, nameof(choosableCapabilities)); + + Usage = usage; + ChoosableCapabilities = choosableCapabilities.ToList(); + AcquiredCapabilities = new ChangeTrackingList(); + AvailableCapabilities = new ChangeTrackingList(); + AdditionalUsages = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectNumberConfig(string usage, IList choosableCapabilities, IReadOnlyList acquiredCapabilities, IReadOnlyList availableCapabilities, IList additionalUsages, string civicAddressId, string locationId, bool? allowTenantAddressUpdate, string displayedCountryCode, IDictionary serializedAdditionalRawData) + { + Usage = usage; + ChoosableCapabilities = choosableCapabilities; + AcquiredCapabilities = acquiredCapabilities; + AvailableCapabilities = availableCapabilities; + AdditionalUsages = additionalUsages; + CivicAddressId = civicAddressId; + LocationId = locationId; + AllowTenantAddressUpdate = allowTenantAddressUpdate; + DisplayedCountryCode = displayedCountryCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectNumberConfig() + { + } + + /// The usage for this telephone number. + public string Usage { get; set; } + /// The choosable capabilities for this telephone number. + public IList ChoosableCapabilities { get; } + /// The acquired capabilities for this telephone number. + public IReadOnlyList AcquiredCapabilities { get; } + /// The available capabilities for this telephone number. + public IReadOnlyList AvailableCapabilities { get; } + /// The additional usages for this telephone number. + public IList AdditionalUsages { get; } + /// The ID of the civic address to be used as the emergency address for this telephone number. + public string CivicAddressId { get; set; } + /// The ID of the location to be used as the emergency address for this telephone number. + public string LocationId { get; set; } + /// If the enterprise is allowed to update the address for this telephone number. + public bool? AllowTenantAddressUpdate { get; set; } + /// The country code to be displayed with this telephone number. + public string DisplayedCountryCode { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs new file mode 100644 index 000000000000..6ca6b3b8c70a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (Optional.IsDefined(AssignmentStatus)) + { + writer.WritePropertyName("assignmentStatus"u8); + writer.WriteStringValue(AssignmentStatus.Value.ToString()); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement, options); + } + + internal static TeamsOperatorConnectNumberDetails DeserializeTeamsOperatorConnectNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + TelephoneNumberAssignmentStatus? assignmentStatus = default; + TeamsOperatorConnectNumberConfig configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assignmentStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignmentStatus = new TelephoneNumberAssignmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsOperatorConnectNumberConfig.DeserializeTeamsOperatorConnectNumberConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectNumberDetails(enabled, assignmentStatus, configuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs new file mode 100644 index 000000000000..052ff99c39f8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Teams Operator Connect service on this Number. + public partial class TeamsOperatorConnectNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsOperatorConnectNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// The assignment status of this Number. + /// The configuration for Teams Operator Connect on this number. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectNumberDetails(bool enabled, TelephoneNumberAssignmentStatus? assignmentStatus, TeamsOperatorConnectNumberConfig configuration, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + AssignmentStatus = assignmentStatus; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + /// The assignment status of this Number. + public TelephoneNumberAssignmentStatus? AssignmentStatus { get; set; } + /// The configuration for Teams Operator Connect on this number. + public TeamsOperatorConnectNumberConfig Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs new file mode 100644 index 000000000000..580d92bbeed3 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement, options); + } + + internal static TeamsPhoneMobileAccountDetails DeserializeTeamsPhoneMobileAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs new file mode 100644 index 000000000000..d1896867d8c2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Phone Mobile. + public partial class TeamsPhoneMobileAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsPhoneMobileAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs new file mode 100644 index 000000000000..a508bb96102a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileNumberConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(AcquiredCapabilities)) + { + writer.WritePropertyName("acquiredCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AcquiredCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AvailableCapabilities)) + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AdditionalUsages)) + { + writer.WritePropertyName("additionalUsages"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUsages) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CivicAddressId)) + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (Optional.IsDefined(LocationId)) + { + writer.WritePropertyName("locationId"u8); + writer.WriteStringValue(LocationId); + } + if (Optional.IsDefined(AllowTenantAddressUpdate)) + { + writer.WritePropertyName("allowTenantAddressUpdate"u8); + writer.WriteBooleanValue(AllowTenantAddressUpdate.Value); + } + if (Optional.IsDefined(DisplayedCountryCode)) + { + writer.WritePropertyName("displayedCountryCode"u8); + writer.WriteStringValue(DisplayedCountryCode); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileNumberConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement, options); + } + + internal static TeamsPhoneMobileNumberConfig DeserializeTeamsPhoneMobileNumberConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string usage = default; + IList choosableCapabilities = default; + IReadOnlyList acquiredCapabilities = default; + IReadOnlyList availableCapabilities = default; + IList additionalUsages = default; + string civicAddressId = default; + string locationId = default; + bool? allowTenantAddressUpdate = default; + string displayedCountryCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("acquiredCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + acquiredCapabilities = array; + continue; + } + if (property.NameEquals("availableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; + continue; + } + if (property.NameEquals("additionalUsages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + additionalUsages = array; + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locationId"u8)) + { + locationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowTenantAddressUpdate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTenantAddressUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayedCountryCode"u8)) + { + displayedCountryCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileNumberConfig( + usage, + choosableCapabilities, + acquiredCapabilities ?? new ChangeTrackingList(), + availableCapabilities ?? new ChangeTrackingList(), + additionalUsages ?? new ChangeTrackingList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileNumberConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileNumberConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs new file mode 100644 index 000000000000..f735d91ff1d0 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Telephone number configuration for Teams Phone Mobile telephone numbers. + public partial class TeamsPhoneMobileNumberConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// or is null. + public TeamsPhoneMobileNumberConfig(string usage, IEnumerable choosableCapabilities) + { + Argument.AssertNotNull(usage, nameof(usage)); + Argument.AssertNotNull(choosableCapabilities, nameof(choosableCapabilities)); + + Usage = usage; + ChoosableCapabilities = choosableCapabilities.ToList(); + AcquiredCapabilities = new ChangeTrackingList(); + AvailableCapabilities = new ChangeTrackingList(); + AdditionalUsages = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileNumberConfig(string usage, IList choosableCapabilities, IReadOnlyList acquiredCapabilities, IReadOnlyList availableCapabilities, IList additionalUsages, string civicAddressId, string locationId, bool? allowTenantAddressUpdate, string displayedCountryCode, IDictionary serializedAdditionalRawData) + { + Usage = usage; + ChoosableCapabilities = choosableCapabilities; + AcquiredCapabilities = acquiredCapabilities; + AvailableCapabilities = availableCapabilities; + AdditionalUsages = additionalUsages; + CivicAddressId = civicAddressId; + LocationId = locationId; + AllowTenantAddressUpdate = allowTenantAddressUpdate; + DisplayedCountryCode = displayedCountryCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileNumberConfig() + { + } + + /// The usage for this telephone number. + public string Usage { get; set; } + /// The choosable capabilities for this telephone number. + public IList ChoosableCapabilities { get; } + /// The acquired capabilities for this telephone number. + public IReadOnlyList AcquiredCapabilities { get; } + /// The available capabilities for this telephone number. + public IReadOnlyList AvailableCapabilities { get; } + /// The additional usages for this telephone number. + public IList AdditionalUsages { get; } + /// The ID of the civic address to be used as the emergency address for this telephone number. + public string CivicAddressId { get; set; } + /// The ID of the location to be used as the emergency address for this telephone number. + public string LocationId { get; set; } + /// If the enterprise is allowed to update the address for this telephone number. + public bool? AllowTenantAddressUpdate { get; set; } + /// The country code to be displayed with this telephone number. + public string DisplayedCountryCode { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs new file mode 100644 index 000000000000..2da5f0d1a69f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (Optional.IsDefined(AssignmentStatus)) + { + writer.WritePropertyName("assignmentStatus"u8); + writer.WriteStringValue(AssignmentStatus.Value.ToString()); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement, options); + } + + internal static TeamsPhoneMobileNumberDetails DeserializeTeamsPhoneMobileNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + TelephoneNumberAssignmentStatus? assignmentStatus = default; + TeamsPhoneMobileNumberConfig configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assignmentStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignmentStatus = new TelephoneNumberAssignmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsPhoneMobileNumberConfig.DeserializeTeamsPhoneMobileNumberConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileNumberDetails(enabled, assignmentStatus, configuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs new file mode 100644 index 000000000000..e231b281d666 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Teams Phone Mobile service on this Number. + public partial class TeamsPhoneMobileNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsPhoneMobileNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// The assignment status of this Number. + /// The configuration for Teams Phone Mobile on this number. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileNumberDetails(bool enabled, TelephoneNumberAssignmentStatus? assignmentStatus, TeamsPhoneMobileNumberConfig configuration, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + AssignmentStatus = assignmentStatus; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + /// The assignment status of this Number. + public TelephoneNumberAssignmentStatus? AssignmentStatus { get; set; } + /// The configuration for Teams Phone Mobile on this number. + public TeamsPhoneMobileNumberConfig Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs new file mode 100644 index 000000000000..b3162ad16d6e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated sub-client. + /// The TeamsRequestsForInformation sub-client. + public partial class TeamsRequestsForInformation + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TeamsRequestsForInformation for mocking. + protected TeamsRequestsForInformation() + { + } + + /// Initializes a new instance of TeamsRequestsForInformation. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The to use. + /// The API version to use for this operation. + internal TeamsRequestsForInformation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Request for Information using its ID. + /// + public virtual async Task> GetRequestForInformationAsync(string tenantId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetRequestForInformationAsync(tenantId, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(RequestForInformationResource.FromResponse(response), response); + } + + /// Get Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Request for Information using its ID. + /// + public virtual Response GetRequestForInformation(string tenantId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetRequestForInformation(tenantId, requestConditions, context); + return Response.FromValue(RequestForInformationResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetRequestForInformationAsync(string tenantId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.GetRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRequestForInformationRequest(tenantId, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetRequestForInformation(string tenantId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.GetRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRequestForInformationRequest(tenantId, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateRequestForInformationAsync(string tenantId, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.CreateOrUpdateRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequestForInformationRequest(tenantId, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdateRequestForInformation(string tenantId, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.CreateOrUpdateRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequestForInformationRequest(tenantId, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get list of Requests for Information. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Requests for Information with details. + /// + public virtual AsyncPageable GetRequestForInformationResourcesAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => RequestForInformationResource.DeserializeRequestForInformationResource(e), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// Get list of Requests for Information. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Requests for Information with details. + /// + public virtual Pageable GetRequestForInformationResources(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => RequestForInformationResource.DeserializeRequestForInformationResource(e), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Requests for Information + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetRequestForInformationResourcesAsync(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Requests for Information + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetRequestForInformationResources(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + internal HttpMessage CreateGetRequestForInformationResourcesRequest(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetRequestForInformationRequest(string tenantId, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation/", false); + uri.AppendPath(tenantId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequestForInformationRequest(string tenantId, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation/", false); + uri.AppendPath(tenantId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetRequestForInformationResourcesNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs new file mode 100644 index 000000000000..266e637ec506 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Indicates whether a number is assigned to a user. + public readonly partial struct TelephoneNumberAssignmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TelephoneNumberAssignmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AssignedValue = "assigned"; + private const string UnassignedValue = "unassigned"; + + /// The telephone number is assigned to a user. + public static TelephoneNumberAssignmentStatus Assigned { get; } = new TelephoneNumberAssignmentStatus(AssignedValue); + /// The telephone number is not assigned to a user. + public static TelephoneNumberAssignmentStatus Unassigned { get; } = new TelephoneNumberAssignmentStatus(UnassignedValue); + /// Determines if two values are the same. + public static bool operator ==(TelephoneNumberAssignmentStatus left, TelephoneNumberAssignmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TelephoneNumberAssignmentStatus left, TelephoneNumberAssignmentStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TelephoneNumberAssignmentStatus(string value) => new TelephoneNumberAssignmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TelephoneNumberAssignmentStatus other && Equals(other); + /// + public bool Equals(TelephoneNumberAssignmentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs new file mode 100644 index 000000000000..1fc7f54a64d0 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The possible validation status of Teams Civic Addresses. + public readonly partial struct ValidationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ValidationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotValidatedValue = "notValidated"; + private const string ValidatedValue = "validated"; + + /// The civic address is not validated. + public static ValidationStatus NotValidated { get; } = new ValidationStatus(NotValidatedValue); + /// The civic address is validated. + public static ValidationStatus Validated { get; } = new ValidationStatus(ValidatedValue); + /// Determines if two values are the same. + public static bool operator ==(ValidationStatus left, ValidationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidationStatus left, ValidationStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ValidationStatus(string value) => new ValidationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidationStatus other && Equals(other); + /// + public bool Equals(ValidationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs new file mode 100644 index 000000000000..9f53592ebc6a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated client. + /// The VoiceServices service client. + public partial class VoiceServicesClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of VoiceServicesClient for mocking. + protected VoiceServicesClient() + { + } + + /// Initializes a new instance of VoiceServicesClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public VoiceServicesClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new VoiceServicesClientOptions()) + { + } + + /// Initializes a new instance of VoiceServicesClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public VoiceServicesClient(Uri endpoint, TokenCredential credential, VoiceServicesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new VoiceServicesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// List all the Numbers associated with this Communications Gateway. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// + public virtual async Task> GetNumbersAsync(int? top = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetNumbersAsync(top, skip, maxpagesize, filter, countRecords, context).ConfigureAwait(false); + return Response.FromValue(PagedNumberList.FromResponse(response), response); + } + + /// List all the Numbers associated with this Communications Gateway. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// + public virtual Response GetNumbers(int? top = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetNumbers(top, skip, maxpagesize, filter, countRecords, context); + return Response.FromValue(PagedNumberList.FromResponse(response), response); + } + + /// + /// [Protocol Method] List all the Numbers associated with this Communications Gateway. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetNumbersAsync(int? top, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("VoiceServicesClient.GetNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumbersRequest(top, skip, maxpagesize, filter, countRecords, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] List all the Numbers associated with this Communications Gateway. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetNumbers(int? top, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("VoiceServicesClient.GetNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumbersRequest(top, skip, maxpagesize, filter, countRecords, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + private Accounts _cachedAccounts; + private TeamsRequestsForInformation _cachedTeamsRequestsForInformation; + + /// Initializes a new instance of Accounts. + public virtual Accounts GetAccountsClient() + { + return Volatile.Read(ref _cachedAccounts) ?? Interlocked.CompareExchange(ref _cachedAccounts, new Accounts(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedAccounts; + } + + /// Initializes a new instance of TeamsRequestsForInformation. + public virtual TeamsRequestsForInformation GetTeamsRequestsForInformationClient() + { + return Volatile.Read(ref _cachedTeamsRequestsForInformation) ?? Interlocked.CompareExchange(ref _cachedTeamsRequestsForInformation, new TeamsRequestsForInformation(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedTeamsRequestsForInformation; + } + + internal HttpMessage CreateGetNumbersRequest(int? top, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/numbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs new file mode 100644 index 000000000000..3de5d3b1a424 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Client options for VoiceServicesClient. + public partial class VoiceServicesClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_02_29_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-02-29-preview". + V2024_02_29_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of VoiceServicesClientOptions. + public VoiceServicesClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_02_29_Preview => "2024-02-29-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs new file mode 100644 index 000000000000..00f500716aad --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ZoomPhoneCloudPeeringAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ZoomPhoneCloudPeeringAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement, options); + } + + internal static ZoomPhoneCloudPeeringAccountDetails DeserializeZoomPhoneCloudPeeringAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ZoomPhoneCloudPeeringAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + ZoomPhoneCloudPeeringAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ZoomPhoneCloudPeeringAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs new file mode 100644 index 000000000000..2241ffb21ba7 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Zoom Phone Cloud Peering. + public partial class ZoomPhoneCloudPeeringAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ZoomPhoneCloudPeeringAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs new file mode 100644 index 000000000000..0ac5ca288dce --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ZoomPhoneCloudPeeringNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ZoomPhoneCloudPeeringNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement, options); + } + + internal static ZoomPhoneCloudPeeringNumberDetails DeserializeZoomPhoneCloudPeeringNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ZoomPhoneCloudPeeringNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + ZoomPhoneCloudPeeringNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ZoomPhoneCloudPeeringNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs new file mode 100644 index 000000000000..eafd400491c4 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Zoom Phone Cloud Peering service on this Number. + public partial class ZoomPhoneCloudPeeringNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public ZoomPhoneCloudPeeringNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// Keeps track of any properties unknown to the library. + internal ZoomPhoneCloudPeeringNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ZoomPhoneCloudPeeringNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj new file mode 100644 index 000000000000..b143463061ac --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj @@ -0,0 +1,19 @@ + + + This is the Microsoft.VoiceServices.Provisioning client library for developing .NET applications with rich experience. + Azure SDK Code Generation Microsoft.VoiceServices.Provisioning for Azure Data Plane + 1.0.0-beta.1 + Microsoft.VoiceServices.Provisioning + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d37c9d4475c3 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.VoiceServices.Provisioning.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs new file mode 100644 index 000000000000..343e903baafd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs @@ -0,0 +1,2678 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_Accounts + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + }); + Response response = client.CreateOrReplace("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + }); + Response response = await client.CreateOrReplaceAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource(""); + Response response = client.CreateOrReplace("", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource(""); + Response response = await client.CreateOrReplaceAsync("", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + }); + Response response = client.CreateOrReplace("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + }); + Response response = await client.CreateOrReplaceAsync("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource("") + { + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, + }; + Response response = client.CreateOrReplace("", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource("") + { + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, + }; + Response response = await client.CreateOrReplaceAsync("", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_Delete_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.Delete(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_Delete_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_Delete_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.Delete("", deleteNumbers: true, requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_Delete_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteAsync("", deleteNumbers: true, requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new object(), +} + }, + }); + Response response = client.CreateOrUpdateNumbers("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new object(), +} + }, + }); + Response response = await client.CreateOrUpdateNumbersAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails()) + }); + Response response = client.CreateOrUpdateNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails()) + }); + Response response = await client.CreateOrUpdateNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new +{ +teamsOperatorConnect = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +teamsDirectRouting = new +{ +enabled = true, +}, +teamsPhoneMobile = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +zoomPhoneCloudPeering = new +{ +enabled = true, +}, +azureOperatorCallProtection = new +{ +enabled = true, +}, +}, +configuration = new +{ +customSipHeader = "", +}, +} + }, + }); + Response response = client.CreateOrUpdateNumbers("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new +{ +teamsOperatorConnect = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +teamsDirectRouting = new +{ +enabled = true, +}, +teamsPhoneMobile = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +zoomPhoneCloudPeering = new +{ +enabled = true, +}, +azureOperatorCallProtection = new +{ +enabled = true, +}, +}, +configuration = new +{ +customSipHeader = "", +}, +} + }, + }); + Response response = await client.CreateOrUpdateNumbersAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails +{ +TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), +TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), +AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ +Configuration = new NumberConfiguration +{ +CustomSipHeader = "", +}, +} + }); + Response response = client.CreateOrUpdateNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails +{ +TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), +TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), +AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ +Configuration = new NumberConfiguration +{ +CustomSipHeader = "", +}, +} + }); + Response response = await client.CreateOrUpdateNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.DeleteNumbers("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.DeleteNumbersAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.DeleteNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.DeleteNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.DeleteNumbers("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.DeleteNumbersAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.DeleteNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.DeleteNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + }); + Response response = client.CreateOrReplaceNumber("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + }); + Response response = await client.CreateOrReplaceNumberAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); + Response response = client.CreateOrReplaceNumber("", "", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); + Response response = await client.CreateOrReplaceNumberAsync("", "", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + }); + Response response = client.CreateOrReplaceNumber("", "", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + }); + Response response = await client.CreateOrReplaceNumberAsync("", "", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + }; + Response response = client.CreateOrReplaceNumber("", "", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + }; + Response response = await client.CreateOrReplaceNumberAsync("", "", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_DeleteNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.DeleteNumber("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_DeleteNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteNumberAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_DeleteNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.DeleteNumber("", "", requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_DeleteNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteNumberAsync("", "", requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.GetTeamsAvailableCapabilities("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.GetTeamsAvailableCapabilities("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.GetTeamsAvailableCapabilities("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.GetTeamsAvailableCapabilities("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetAccountResources(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetAccountResourcesAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (AccountResource item in client.GetAccountResources()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (AccountResource item in client.GetAccountResourcesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetAccountResources(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetAccountResourcesAsync(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (AccountResource item in client.GetAccountResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (AccountResource item in client.GetAccountResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetNumbers("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetNumbersAsync("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (NumberResource item in client.GetNumbers("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (NumberResource item in client.GetNumbersAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetNumbers("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetNumbersAsync("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (NumberResource item in client.GetNumbers("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (NumberResource item in client.GetNumbersAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetTeamsCivicAddresses("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetTeamsCivicAddresses("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs new file mode 100644 index 000000000000..a96abe86f493 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_TeamsRequestsForInformation + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.CreateOrUpdateRequestForInformation("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.CreateOrUpdateRequestForInformationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new + { + customerRelationship = new + { + status = "", + comment = "", + }, + }); + Response response = client.CreateOrUpdateRequestForInformation("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new + { + customerRelationship = new + { + status = "", + comment = "", + }, + }); + Response response = await client.CreateOrUpdateRequestForInformationAsync("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (BinaryData item in client.GetRequestForInformationResources(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (RequestForInformationResource item in client.GetRequestForInformationResources()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (BinaryData item in client.GetRequestForInformationResources(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (RequestForInformationResource item in client.GetRequestForInformationResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs new file mode 100644 index 000000000000..ce35a6ad1cab --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_VoiceServicesClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = client.GetNumbers(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = await client.GetNumbersAsync(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = client.GetNumbers(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = await client.GetNumbersAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = client.GetNumbers(1234, 1234, 1234, "", true, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = await client.GetNumbersAsync(1234, 1234, 1234, "", true, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = client.GetNumbers(top: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + Response response = await client.GetNumbersAsync(top: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj new file mode 100644 index 000000000000..de28dc09a86a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj @@ -0,0 +1,19 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml new file mode 100644 index 000000000000..6fde92232e52 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/voiceservices/VoiceServices.Provisioning +commit: 564bc134700944a7c4372730f23a15c86c46be26 +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml index 837c4b587a84..174cfc9fa6af 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml +++ b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/translation/Azure.AI.DocumentTranslation -commit: 27a9398801386caaba2df7e1a4d1a8abd19e3789 -repo: Azure/azure-rest-api-specs +commit: 564bc134700944a7c4372730f23a15c86c46be26 +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/translation/Azure.AI.Translation.Text/api/Azure.AI.Translation.Text.netstandard2.0.cs b/sdk/translation/Azure.AI.Translation.Text/api/Azure.AI.Translation.Text.netstandard2.0.cs index 2948eae5d9e3..b49f193ae595 100644 --- a/sdk/translation/Azure.AI.Translation.Text/api/Azure.AI.Translation.Text.netstandard2.0.cs +++ b/sdk/translation/Azure.AI.Translation.Text/api/Azure.AI.Translation.Text.netstandard2.0.cs @@ -2,24 +2,24 @@ namespace Azure.AI.Translation.Text { public static partial class AITranslationTextModelFactory { - public static Azure.AI.Translation.Text.BackTranslation BackTranslation(string normalizedText = null, string displayText = null, int examplesCount = 0, int frequencyCount = 0) { throw null; } - public static Azure.AI.Translation.Text.BreakSentenceItem BreakSentenceItem(Azure.AI.Translation.Text.DetectedLanguage detectedLanguage = null, System.Collections.Generic.IEnumerable sentencesLengths = null) { throw null; } - public static Azure.AI.Translation.Text.DetectedLanguage DetectedLanguage(string language = null, float confidence = 0f) { throw null; } + public static Azure.AI.Translation.Text.BackTranslation BackTranslation(string normalizedText = null, string displayText = null, int numExamples = 0, int frequencyCount = 0) { throw null; } + public static Azure.AI.Translation.Text.BreakSentenceItem BreakSentenceItem(Azure.AI.Translation.Text.DetectedLanguage detectedLanguage = null, System.Collections.Generic.IEnumerable sentLen = null) { throw null; } + public static Azure.AI.Translation.Text.DetectedLanguage DetectedLanguage(string language = null, float score = 0f) { throw null; } public static Azure.AI.Translation.Text.DictionaryExample DictionaryExample(string sourcePrefix = null, string sourceTerm = null, string sourceSuffix = null, string targetPrefix = null, string targetTerm = null, string targetSuffix = null) { throw null; } public static Azure.AI.Translation.Text.DictionaryExampleItem DictionaryExampleItem(string normalizedSource = null, string normalizedTarget = null, System.Collections.Generic.IEnumerable examples = null) { throw null; } public static Azure.AI.Translation.Text.DictionaryLookupItem DictionaryLookupItem(string normalizedSource = null, string displaySource = null, System.Collections.Generic.IEnumerable translations = null) { throw null; } public static Azure.AI.Translation.Text.DictionaryTranslation DictionaryTranslation(string normalizedTarget = null, string displayTarget = null, string posTag = null, float confidence = 0f, string prefixWord = null, System.Collections.Generic.IEnumerable backTranslations = null) { throw null; } public static Azure.AI.Translation.Text.GetSupportedLanguagesResult GetSupportedLanguagesResult(System.Collections.Generic.IReadOnlyDictionary translation = null, System.Collections.Generic.IReadOnlyDictionary transliteration = null, System.Collections.Generic.IReadOnlyDictionary dictionary = null) { throw null; } - public static Azure.AI.Translation.Text.LanguageScript LanguageScript(string code = null, string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality directionality = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight) { throw null; } - public static Azure.AI.Translation.Text.SentenceBoundaries SentenceBoundaries(System.Collections.Generic.IEnumerable sourceSentencesLengths = null, System.Collections.Generic.IEnumerable translatedSentencesLengths = null) { throw null; } - public static Azure.AI.Translation.Text.SourceDictionaryLanguage SourceDictionaryLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality directionality = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, System.Collections.Generic.IEnumerable translations = null) { throw null; } + public static Azure.AI.Translation.Text.LanguageScript LanguageScript(string code = null, string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality dir = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight) { throw null; } + public static Azure.AI.Translation.Text.SentenceBoundaries SentenceBoundaries(System.Collections.Generic.IEnumerable srcSentLen = null, System.Collections.Generic.IEnumerable transSentLen = null) { throw null; } + public static Azure.AI.Translation.Text.SourceDictionaryLanguage SourceDictionaryLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality dir = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, System.Collections.Generic.IEnumerable translations = null) { throw null; } public static Azure.AI.Translation.Text.SourceText SourceText(string text = null) { throw null; } - public static Azure.AI.Translation.Text.TargetDictionaryLanguage TargetDictionaryLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality directionality = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, string code = null) { throw null; } - public static Azure.AI.Translation.Text.TranslatedTextAlignment TranslatedTextAlignment(string projections = null) { throw null; } + public static Azure.AI.Translation.Text.TargetDictionaryLanguage TargetDictionaryLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality dir = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, string code = null) { throw null; } + public static Azure.AI.Translation.Text.TranslatedTextAlignment TranslatedTextAlignment(string proj = null) { throw null; } public static Azure.AI.Translation.Text.TranslatedTextItem TranslatedTextItem(Azure.AI.Translation.Text.DetectedLanguage detectedLanguage = null, System.Collections.Generic.IEnumerable translations = null, Azure.AI.Translation.Text.SourceText sourceText = null) { throw null; } - public static Azure.AI.Translation.Text.TranslationLanguage TranslationLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality directionality = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight) { throw null; } - public static Azure.AI.Translation.Text.TranslationText TranslationText(string targetLanguage = null, string text = null, Azure.AI.Translation.Text.TransliteratedText transliteration = null, Azure.AI.Translation.Text.TranslatedTextAlignment alignment = null, Azure.AI.Translation.Text.SentenceBoundaries sentenceBoundaries = null) { throw null; } - public static Azure.AI.Translation.Text.TransliterableScript TransliterableScript(string code = null, string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality directionality = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, System.Collections.Generic.IEnumerable targetLanguageScripts = null) { throw null; } + public static Azure.AI.Translation.Text.TranslationLanguage TranslationLanguage(string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality dir = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight) { throw null; } + public static Azure.AI.Translation.Text.TranslationText TranslationText(string to = null, string text = null, Azure.AI.Translation.Text.TransliteratedText transliteration = null, Azure.AI.Translation.Text.TranslatedTextAlignment alignment = null, Azure.AI.Translation.Text.SentenceBoundaries sentLen = null) { throw null; } + public static Azure.AI.Translation.Text.TransliterableScript TransliterableScript(string code = null, string name = null, string nativeName = null, Azure.AI.Translation.Text.LanguageDirectionality dir = Azure.AI.Translation.Text.LanguageDirectionality.LeftToRight, System.Collections.Generic.IEnumerable toScripts = null) { throw null; } public static Azure.AI.Translation.Text.TransliteratedText TransliteratedText(string text = null, string script = null) { throw null; } public static Azure.AI.Translation.Text.TransliterationLanguage TransliterationLanguage(string name = null, string nativeName = null, System.Collections.Generic.IEnumerable scripts = null) { throw null; } } @@ -27,9 +27,9 @@ public partial class BackTranslation : System.ClientModel.Primitives.IJsonModel< { internal BackTranslation() { } public string DisplayText { get { throw null; } } - public int ExamplesCount { get { throw null; } } public int FrequencyCount { get { throw null; } } public string NormalizedText { get { throw null; } } + public int NumExamples { get { throw null; } } Azure.AI.Translation.Text.BackTranslation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.BackTranslation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -40,7 +40,7 @@ public partial class BreakSentenceItem : System.ClientModel.Primitives.IJsonMode { internal BreakSentenceItem() { } public Azure.AI.Translation.Text.DetectedLanguage DetectedLanguage { get { throw null; } } - public System.Collections.Generic.IReadOnlyList SentencesLengths { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SentLen { get { throw null; } } Azure.AI.Translation.Text.BreakSentenceItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.BreakSentenceItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -50,8 +50,8 @@ internal BreakSentenceItem() { } public partial class DetectedLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal DetectedLanguage() { } - public float Confidence { get { throw null; } } public string Language { get { throw null; } } + public float Score { get { throw null; } } Azure.AI.Translation.Text.DetectedLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.DetectedLanguage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -159,7 +159,7 @@ public partial class LanguageScript : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -182,8 +182,8 @@ public enum ProfanityMarker public partial class SentenceBoundaries : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SentenceBoundaries() { } - public System.Collections.Generic.IReadOnlyList SourceSentencesLengths { get { throw null; } } - public System.Collections.Generic.IReadOnlyList TranslatedSentencesLengths { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SrcSentLen { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TransSentLen { get { throw null; } } Azure.AI.Translation.Text.SentenceBoundaries System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.SentenceBoundaries System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -193,7 +193,7 @@ internal SentenceBoundaries() { } public partial class SourceDictionaryLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SourceDictionaryLanguage() { } - public Azure.AI.Translation.Text.LanguageDirectionality Directionality { get { throw null; } } + public Azure.AI.Translation.Text.LanguageDirectionality Dir { get { throw null; } } public string Name { get { throw null; } } public string NativeName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Translations { get { throw null; } } @@ -217,7 +217,7 @@ public partial class TargetDictionaryLanguage : System.ClientModel.Primitives.IJ { internal TargetDictionaryLanguage() { } public string Code { get { throw null; } } - public Azure.AI.Translation.Text.LanguageDirectionality Directionality { get { throw null; } } + public Azure.AI.Translation.Text.LanguageDirectionality Dir { get { throw null; } } public string Name { get { throw null; } } public string NativeName { get { throw null; } } Azure.AI.Translation.Text.TargetDictionaryLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -328,7 +328,7 @@ public partial class TextTranslationTransliterateOptions public partial class TranslatedTextAlignment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TranslatedTextAlignment() { } - public string Projections { get { throw null; } } + public string Proj { get { throw null; } } Azure.AI.Translation.Text.TranslatedTextAlignment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.TranslatedTextAlignment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -350,7 +350,7 @@ internal TranslatedTextItem() { } public partial class TranslationLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TranslationLanguage() { } - public Azure.AI.Translation.Text.LanguageDirectionality Directionality { get { throw null; } } + public Azure.AI.Translation.Text.LanguageDirectionality Dir { get { throw null; } } public string Name { get { throw null; } } public string NativeName { get { throw null; } } Azure.AI.Translation.Text.TranslationLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -363,9 +363,9 @@ public partial class TranslationText : System.ClientModel.Primitives.IJsonModel< { internal TranslationText() { } public Azure.AI.Translation.Text.TranslatedTextAlignment Alignment { get { throw null; } } - public Azure.AI.Translation.Text.SentenceBoundaries SentenceBoundaries { get { throw null; } } - public string TargetLanguage { get { throw null; } } + public Azure.AI.Translation.Text.SentenceBoundaries SentLen { get { throw null; } } public string Text { get { throw null; } } + public string To { get { throw null; } } public Azure.AI.Translation.Text.TransliteratedText Transliteration { get { throw null; } } Azure.AI.Translation.Text.TranslationText System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -376,7 +376,7 @@ internal TranslationText() { } public partial class TransliterableScript : Azure.AI.Translation.Text.LanguageScript, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TransliterableScript() { } - public System.Collections.Generic.IReadOnlyList TargetLanguageScripts { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ToScripts { get { throw null; } } Azure.AI.Translation.Text.TransliterableScript System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Translation.Text.TransliterableScript System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/AITranslationTextModelFactory.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/AITranslationTextModelFactory.cs index 2348b6d02f3d..7ecbf4b5c5d2 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/AITranslationTextModelFactory.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/AITranslationTextModelFactory.cs @@ -30,11 +30,11 @@ public static GetSupportedLanguagesResult GetSupportedLanguagesResult(IReadOnlyD /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// A new instance for mocking. - public static TranslationLanguage TranslationLanguage(string name = null, string nativeName = null, LanguageDirectionality directionality = default) + public static TranslationLanguage TranslationLanguage(string name = null, string nativeName = null, LanguageDirectionality dir = default) { - return new TranslationLanguage(name, nativeName, directionality, serializedAdditionalRawData: null); + return new TranslationLanguage(name, nativeName, dir, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -53,55 +53,55 @@ public static TransliterationLanguage TransliterationLanguage(string name = null /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - /// List of scripts available to convert text to. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// List of scripts available to convert text to. /// A new instance for mocking. - public static TransliterableScript TransliterableScript(string code = null, string name = null, string nativeName = null, LanguageDirectionality directionality = default, IEnumerable targetLanguageScripts = null) + public static TransliterableScript TransliterableScript(string code = null, string name = null, string nativeName = null, LanguageDirectionality dir = default, IEnumerable toScripts = null) { - targetLanguageScripts ??= new List(); + toScripts ??= new List(); return new TransliterableScript( code, name, nativeName, - directionality, + dir, serializedAdditionalRawData: null, - targetLanguageScripts?.ToList()); + toScripts?.ToList()); } /// Initializes a new instance of . /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// A new instance for mocking. - public static LanguageScript LanguageScript(string code = null, string name = null, string nativeName = null, LanguageDirectionality directionality = default) + public static LanguageScript LanguageScript(string code = null, string name = null, string nativeName = null, LanguageDirectionality dir = default) { - return new LanguageScript(code, name, nativeName, directionality, serializedAdditionalRawData: null); + return new LanguageScript(code, name, nativeName, dir, serializedAdditionalRawData: null); } /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// List of languages with alterative translations and examples for the query expressed in the source language. /// A new instance for mocking. - public static SourceDictionaryLanguage SourceDictionaryLanguage(string name = null, string nativeName = null, LanguageDirectionality directionality = default, IEnumerable translations = null) + public static SourceDictionaryLanguage SourceDictionaryLanguage(string name = null, string nativeName = null, LanguageDirectionality dir = default, IEnumerable translations = null) { translations ??= new List(); - return new SourceDictionaryLanguage(name, nativeName, directionality, translations?.ToList(), serializedAdditionalRawData: null); + return new SourceDictionaryLanguage(name, nativeName, dir, translations?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Language code identifying the target language. /// A new instance for mocking. - public static TargetDictionaryLanguage TargetDictionaryLanguage(string name = null, string nativeName = null, LanguageDirectionality directionality = default, string code = null) + public static TargetDictionaryLanguage TargetDictionaryLanguage(string name = null, string nativeName = null, LanguageDirectionality dir = default, string code = null) { - return new TargetDictionaryLanguage(name, nativeName, directionality, code, serializedAdditionalRawData: null); + return new TargetDictionaryLanguage(name, nativeName, dir, code, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -126,31 +126,31 @@ public static TranslatedTextItem TranslatedTextItem(DetectedLanguage detectedLan /// Initializes a new instance of . /// A string representing the code of the detected language. - /// + /// /// A float value indicating the confidence in the result. /// The score is between zero and one and a low score indicates a low confidence. /// /// A new instance for mocking. - public static DetectedLanguage DetectedLanguage(string language = null, float confidence = default) + public static DetectedLanguage DetectedLanguage(string language = null, float score = default) { - return new DetectedLanguage(language, confidence, serializedAdditionalRawData: null); + return new DetectedLanguage(language, score, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// A string representing the language code of the target language. + /// A string representing the language code of the target language. /// A string giving the translated text. /// An object giving the translated text in the script specified by the toScript parameter. /// Alignment information. - /// Sentence boundaries in the input and output texts. + /// Sentence boundaries in the input and output texts. /// A new instance for mocking. - public static TranslationText TranslationText(string targetLanguage = null, string text = null, TransliteratedText transliteration = null, TranslatedTextAlignment alignment = null, SentenceBoundaries sentenceBoundaries = null) + public static TranslationText TranslationText(string to = null, string text = null, TransliteratedText transliteration = null, TranslatedTextAlignment alignment = null, SentenceBoundaries sentLen = null) { return new TranslationText( - targetLanguage, + to, text, transliteration, alignment, - sentenceBoundaries, + sentLen, serializedAdditionalRawData: null); } @@ -164,7 +164,7 @@ public static TransliteratedText TransliteratedText(string text = null, string s } /// Initializes a new instance of . - /// + /// /// Maps input text to translated text. The alignment information is only provided when the request /// parameter includeAlignment is true. Alignment is returned as a string value of the following /// format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. @@ -173,27 +173,27 @@ public static TransliteratedText TransliteratedText(string text = null, string s /// be non-contiguous. When no alignment information is available, the alignment element will be empty. /// /// A new instance for mocking. - public static TranslatedTextAlignment TranslatedTextAlignment(string projections = null) + public static TranslatedTextAlignment TranslatedTextAlignment(string proj = null) { - return new TranslatedTextAlignment(projections, serializedAdditionalRawData: null); + return new TranslatedTextAlignment(proj, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - /// + /// /// An integer array representing the lengths of the sentences in the translated text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// /// A new instance for mocking. - public static SentenceBoundaries SentenceBoundaries(IEnumerable sourceSentencesLengths = null, IEnumerable translatedSentencesLengths = null) + public static SentenceBoundaries SentenceBoundaries(IEnumerable srcSentLen = null, IEnumerable transSentLen = null) { - sourceSentencesLengths ??= new List(); - translatedSentencesLengths ??= new List(); + srcSentLen ??= new List(); + transSentLen ??= new List(); - return new SentenceBoundaries(sourceSentencesLengths?.ToList(), translatedSentencesLengths?.ToList(), serializedAdditionalRawData: null); + return new SentenceBoundaries(srcSentLen?.ToList(), transSentLen?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -206,16 +206,16 @@ public static SourceText SourceText(string text = null) /// Initializes a new instance of . /// The detectedLanguage property is only present in the result object when language auto-detection is requested. - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// /// A new instance for mocking. - public static BreakSentenceItem BreakSentenceItem(DetectedLanguage detectedLanguage = null, IEnumerable sentencesLengths = null) + public static BreakSentenceItem BreakSentenceItem(DetectedLanguage detectedLanguage = null, IEnumerable sentLen = null) { - sentencesLengths ??= new List(); + sentLen ??= new List(); - return new BreakSentenceItem(detectedLanguage, sentencesLengths?.ToList(), serializedAdditionalRawData: null); + return new BreakSentenceItem(detectedLanguage, sentLen?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -292,7 +292,7 @@ public static DictionaryTranslation DictionaryTranslation(string normalizedTarge /// A string giving the source term that is a back-translation of the target in a form best /// suited for end-user display. /// - /// + /// /// An integer representing the number of examples that are available for this translation pair. /// Actual examples must be retrieved with a separate call to lookup examples. The number is mostly /// intended to facilitate display in a UX. For example, a user interface may add a hyperlink @@ -306,9 +306,9 @@ public static DictionaryTranslation DictionaryTranslation(string normalizedTarge /// field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. /// /// A new instance for mocking. - public static BackTranslation BackTranslation(string normalizedText = null, string displayText = null, int examplesCount = default, int frequencyCount = default) + public static BackTranslation BackTranslation(string normalizedText = null, string displayText = null, int numExamples = default, int frequencyCount = default) { - return new BackTranslation(normalizedText, displayText, examplesCount, frequencyCount, serializedAdditionalRawData: null); + return new BackTranslation(normalizedText, displayText, numExamples, frequencyCount, serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.Serialization.cs index 1f418cdfe251..26019bd61380 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.Serialization.cs @@ -31,7 +31,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WritePropertyName("displayText"u8); writer.WriteStringValue(DisplayText); writer.WritePropertyName("numExamples"u8); - writer.WriteNumberValue(ExamplesCount); + writer.WriteNumberValue(NumExamples); writer.WritePropertyName("frequencyCount"u8); writer.WriteNumberValue(FrequencyCount); if (options.Format != "W" && _serializedAdditionalRawData != null) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.cs index 5eeb74c3c083..9e30c50706fe 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BackTranslation.cs @@ -54,7 +54,7 @@ public partial class BackTranslation /// A string giving the source term that is a back-translation of the target in a form best /// suited for end-user display. /// - /// + /// /// An integer representing the number of examples that are available for this translation pair. /// Actual examples must be retrieved with a separate call to lookup examples. The number is mostly /// intended to facilitate display in a UX. For example, a user interface may add a hyperlink @@ -68,14 +68,14 @@ public partial class BackTranslation /// field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. /// /// or is null. - internal BackTranslation(string normalizedText, string displayText, int examplesCount, int frequencyCount) + internal BackTranslation(string normalizedText, string displayText, int numExamples, int frequencyCount) { Argument.AssertNotNull(normalizedText, nameof(normalizedText)); Argument.AssertNotNull(displayText, nameof(displayText)); NormalizedText = normalizedText; DisplayText = displayText; - ExamplesCount = examplesCount; + NumExamples = numExamples; FrequencyCount = frequencyCount; } @@ -88,7 +88,7 @@ internal BackTranslation(string normalizedText, string displayText, int examples /// A string giving the source term that is a back-translation of the target in a form best /// suited for end-user display. /// - /// + /// /// An integer representing the number of examples that are available for this translation pair. /// Actual examples must be retrieved with a separate call to lookup examples. The number is mostly /// intended to facilitate display in a UX. For example, a user interface may add a hyperlink @@ -102,11 +102,11 @@ internal BackTranslation(string normalizedText, string displayText, int examples /// field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. /// /// Keeps track of any properties unknown to the library. - internal BackTranslation(string normalizedText, string displayText, int examplesCount, int frequencyCount, IDictionary serializedAdditionalRawData) + internal BackTranslation(string normalizedText, string displayText, int numExamples, int frequencyCount, IDictionary serializedAdditionalRawData) { NormalizedText = normalizedText; DisplayText = displayText; - ExamplesCount = examplesCount; + NumExamples = numExamples; FrequencyCount = frequencyCount; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -135,7 +135,7 @@ internal BackTranslation() /// by a call to lookup examples may be less than numExamples, because additional filtering may be /// applied on the fly to remove "bad" examples. /// - public int ExamplesCount { get; } + public int NumExamples { get; } /// /// An integer representing the frequency of this translation pair in the data. The main purpose of this /// field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.Serialization.cs index 4b6d05619e33..b7452a0f5729 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.Serialization.cs @@ -33,7 +33,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WritePropertyName("sentLen"u8); writer.WriteStartArray(); - foreach (var item in SentencesLengths) + foreach (var item in SentLen) { writer.WriteNumberValue(item); } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.cs index c1d283a64f86..47a9734eb2e1 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/BreakSentenceItem.cs @@ -47,29 +47,29 @@ public partial class BreakSentenceItem private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - /// is null. - internal BreakSentenceItem(IEnumerable sentencesLengths) + /// is null. + internal BreakSentenceItem(IEnumerable sentLen) { - Argument.AssertNotNull(sentencesLengths, nameof(sentencesLengths)); + Argument.AssertNotNull(sentLen, nameof(sentLen)); - SentencesLengths = sentencesLengths.ToList(); + SentLen = sentLen.ToList(); } /// Initializes a new instance of . /// The detectedLanguage property is only present in the result object when language auto-detection is requested. - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// /// Keeps track of any properties unknown to the library. - internal BreakSentenceItem(DetectedLanguage detectedLanguage, IReadOnlyList sentencesLengths, IDictionary serializedAdditionalRawData) + internal BreakSentenceItem(DetectedLanguage detectedLanguage, IReadOnlyList sentLen, IDictionary serializedAdditionalRawData) { DetectedLanguage = detectedLanguage; - SentencesLengths = sentencesLengths; + SentLen = sentLen; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,6 +84,6 @@ internal BreakSentenceItem() /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - public IReadOnlyList SentencesLengths { get; } + public IReadOnlyList SentLen { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.Serialization.cs index dd3716c9106c..5ed7169c68e2 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.Serialization.cs @@ -29,7 +29,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("language"u8); writer.WriteStringValue(Language); writer.WritePropertyName("score"u8); - writer.WriteNumberValue(Confidence); + writer.WriteNumberValue(Score); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.cs index 22b9c2194b90..3be254c3db19 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/DetectedLanguage.cs @@ -47,30 +47,30 @@ public partial class DetectedLanguage /// Initializes a new instance of . /// A string representing the code of the detected language. - /// + /// /// A float value indicating the confidence in the result. /// The score is between zero and one and a low score indicates a low confidence. /// /// is null. - internal DetectedLanguage(string language, float confidence) + internal DetectedLanguage(string language, float score) { Argument.AssertNotNull(language, nameof(language)); Language = language; - Confidence = confidence; + Score = score; } /// Initializes a new instance of . /// A string representing the code of the detected language. - /// + /// /// A float value indicating the confidence in the result. /// The score is between zero and one and a low score indicates a low confidence. /// /// Keeps track of any properties unknown to the library. - internal DetectedLanguage(string language, float confidence, IDictionary serializedAdditionalRawData) + internal DetectedLanguage(string language, float score, IDictionary serializedAdditionalRawData) { Language = language; - Confidence = confidence; + Score = score; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -85,6 +85,6 @@ internal DetectedLanguage() /// A float value indicating the confidence in the result. /// The score is between zero and one and a low score indicates a low confidence. /// - public float Confidence { get; } + public float Score { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.Serialization.cs index 1ab0a667dbc0..a5c3f01e87f7 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.Serialization.cs @@ -33,7 +33,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WritePropertyName("nativeName"u8); writer.WriteStringValue(NativeName); writer.WritePropertyName("dir"u8); - writer.WriteStringValue(Directionality.ToSerialString()); + writer.WriteStringValue(Dir.ToSerialString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.cs index 94eb100e4809..314371ec9c64 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/LanguageScript.cs @@ -49,9 +49,9 @@ public partial class LanguageScript /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// , or is null. - internal LanguageScript(string code, string name, string nativeName, LanguageDirectionality directionality) + internal LanguageScript(string code, string name, string nativeName, LanguageDirectionality dir) { Argument.AssertNotNull(code, nameof(code)); Argument.AssertNotNull(name, nameof(name)); @@ -60,21 +60,21 @@ internal LanguageScript(string code, string name, string nativeName, LanguageDir Code = code; Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; } /// Initializes a new instance of . /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Keeps track of any properties unknown to the library. - internal LanguageScript(string code, string name, string nativeName, LanguageDirectionality directionality, IDictionary serializedAdditionalRawData) + internal LanguageScript(string code, string name, string nativeName, LanguageDirectionality dir, IDictionary serializedAdditionalRawData) { Code = code; Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,6 +90,6 @@ internal LanguageScript() /// Display name of the language in the locale native for the language. public string NativeName { get; } /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - public LanguageDirectionality Directionality { get; } + public LanguageDirectionality Dir { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.Serialization.cs index 60ed6751efce..d30229ffbbc5 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.Serialization.cs @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartObject(); writer.WritePropertyName("srcSentLen"u8); writer.WriteStartArray(); - foreach (var item in SourceSentencesLengths) + foreach (var item in SrcSentLen) { writer.WriteNumberValue(item); } writer.WriteEndArray(); writer.WritePropertyName("transSentLen"u8); writer.WriteStartArray(); - foreach (var item in TranslatedSentencesLengths) + foreach (var item in TransSentLen) { writer.WriteNumberValue(item); } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.cs index 70fd3b61c965..b800a077525d 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SentenceBoundaries.cs @@ -47,38 +47,38 @@ public partial class SentenceBoundaries private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - /// + /// /// An integer array representing the lengths of the sentences in the translated text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - /// or is null. - internal SentenceBoundaries(IEnumerable sourceSentencesLengths, IEnumerable translatedSentencesLengths) + /// or is null. + internal SentenceBoundaries(IEnumerable srcSentLen, IEnumerable transSentLen) { - Argument.AssertNotNull(sourceSentencesLengths, nameof(sourceSentencesLengths)); - Argument.AssertNotNull(translatedSentencesLengths, nameof(translatedSentencesLengths)); + Argument.AssertNotNull(srcSentLen, nameof(srcSentLen)); + Argument.AssertNotNull(transSentLen, nameof(transSentLen)); - SourceSentencesLengths = sourceSentencesLengths.ToList(); - TranslatedSentencesLengths = translatedSentencesLengths.ToList(); + SrcSentLen = srcSentLen.ToList(); + TransSentLen = transSentLen.ToList(); } /// Initializes a new instance of . - /// + /// /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - /// + /// /// An integer array representing the lengths of the sentences in the translated text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// /// Keeps track of any properties unknown to the library. - internal SentenceBoundaries(IReadOnlyList sourceSentencesLengths, IReadOnlyList translatedSentencesLengths, IDictionary serializedAdditionalRawData) + internal SentenceBoundaries(IReadOnlyList srcSentLen, IReadOnlyList transSentLen, IDictionary serializedAdditionalRawData) { - SourceSentencesLengths = sourceSentencesLengths; - TranslatedSentencesLengths = translatedSentencesLengths; + SrcSentLen = srcSentLen; + TransSentLen = transSentLen; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,11 +91,11 @@ internal SentenceBoundaries() /// An integer array representing the lengths of the sentences in the input text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - public IReadOnlyList SourceSentencesLengths { get; } + public IReadOnlyList SrcSentLen { get; } /// /// An integer array representing the lengths of the sentences in the translated text. /// The length of the array is the number of sentences, and the values are the length of each sentence. /// - public IReadOnlyList TranslatedSentencesLengths { get; } + public IReadOnlyList TransSentLen { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.Serialization.cs index 6ddf9f0f4e80..c75b8bd00344 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.Serialization.cs @@ -31,7 +31,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("nativeName"u8); writer.WriteStringValue(NativeName); writer.WritePropertyName("dir"u8); - writer.WriteStringValue(Directionality.ToSerialString()); + writer.WriteStringValue(Dir.ToSerialString()); writer.WritePropertyName("translations"u8); writer.WriteStartArray(); foreach (var item in Translations) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.cs index cf0a057a1b7b..4ab55b7eac91 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/SourceDictionaryLanguage.cs @@ -49,10 +49,10 @@ public partial class SourceDictionaryLanguage /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// List of languages with alterative translations and examples for the query expressed in the source language. /// , or is null. - internal SourceDictionaryLanguage(string name, string nativeName, LanguageDirectionality directionality, IEnumerable translations) + internal SourceDictionaryLanguage(string name, string nativeName, LanguageDirectionality dir, IEnumerable translations) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(nativeName, nameof(nativeName)); @@ -60,21 +60,21 @@ internal SourceDictionaryLanguage(string name, string nativeName, LanguageDirect Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; Translations = translations.ToList(); } /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// List of languages with alterative translations and examples for the query expressed in the source language. /// Keeps track of any properties unknown to the library. - internal SourceDictionaryLanguage(string name, string nativeName, LanguageDirectionality directionality, IReadOnlyList translations, IDictionary serializedAdditionalRawData) + internal SourceDictionaryLanguage(string name, string nativeName, LanguageDirectionality dir, IReadOnlyList translations, IDictionary serializedAdditionalRawData) { Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; Translations = translations; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -89,7 +89,7 @@ internal SourceDictionaryLanguage() /// Display name of the language in the locale native for this language. public string NativeName { get; } /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - public LanguageDirectionality Directionality { get; } + public LanguageDirectionality Dir { get; } /// List of languages with alterative translations and examples for the query expressed in the source language. public IReadOnlyList Translations { get; } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.Serialization.cs index 28497b3c6f93..6ad3eaa94280 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.Serialization.cs @@ -31,7 +31,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("nativeName"u8); writer.WriteStringValue(NativeName); writer.WritePropertyName("dir"u8); - writer.WriteStringValue(Directionality.ToSerialString()); + writer.WriteStringValue(Dir.ToSerialString()); writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); if (options.Format != "W" && _serializedAdditionalRawData != null) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.cs index 81845ba309e5..c296c28456bf 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TargetDictionaryLanguage.cs @@ -48,10 +48,10 @@ public partial class TargetDictionaryLanguage /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Language code identifying the target language. /// , or is null. - internal TargetDictionaryLanguage(string name, string nativeName, LanguageDirectionality directionality, string code) + internal TargetDictionaryLanguage(string name, string nativeName, LanguageDirectionality dir, string code) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(nativeName, nameof(nativeName)); @@ -59,21 +59,21 @@ internal TargetDictionaryLanguage(string name, string nativeName, LanguageDirect Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; Code = code; } /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Language code identifying the target language. /// Keeps track of any properties unknown to the library. - internal TargetDictionaryLanguage(string name, string nativeName, LanguageDirectionality directionality, string code, IDictionary serializedAdditionalRawData) + internal TargetDictionaryLanguage(string name, string nativeName, LanguageDirectionality dir, string code, IDictionary serializedAdditionalRawData) { Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; Code = code; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,7 +88,7 @@ internal TargetDictionaryLanguage() /// Display name of the language in the locale native for this language. public string NativeName { get; } /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - public LanguageDirectionality Directionality { get; } + public LanguageDirectionality Dir { get; } /// Language code identifying the target language. public string Code { get; } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TextTranslationClient.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TextTranslationClient.cs index a109230e24f6..d7c7f89e113c 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TextTranslationClient.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TextTranslationClient.cs @@ -252,7 +252,7 @@ internal HttpMessage CreateGetSupportedLanguagesRequest(string clientTraceId, st return message; } - internal HttpMessage CreateTranslateRequest(IEnumerable targetLanguages, RequestContent content, string clientTraceId, string sourceLanguage, string textType, string category, string profanityAction, string profanityMarker, bool? includeAlignment, bool? includeSentenceLength, string suggestedSourceLanguage, string sourceLanguageScript, string targetLanguageScript, bool? allowFallback, RequestContext context) + internal HttpMessage CreateTranslateRequest(IEnumerable to, RequestContent content, string clientTraceId, string @from, string textType, string category, string profanityAction, string profanityMarker, bool? includeAlignment, bool? includeSentenceLength, string suggestedFrom, string fromScript, string toScript, bool? allowFallback, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -260,16 +260,16 @@ internal HttpMessage CreateTranslateRequest(IEnumerable targetLanguages, var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/translate", false); - if (targetLanguages != null && !(targetLanguages is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + if (to != null && !(to is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) { - foreach (var param in targetLanguages) + foreach (var param in to) { uri.AppendQuery("to", param, true); } } - if (sourceLanguage != null) + if (@from != null) { - uri.AppendQuery("from", sourceLanguage, true); + uri.AppendQuery("from", @from, true); } if (textType != null) { @@ -295,17 +295,17 @@ internal HttpMessage CreateTranslateRequest(IEnumerable targetLanguages, { uri.AppendQuery("includeSentenceLength", includeSentenceLength.Value, true); } - if (suggestedSourceLanguage != null) + if (suggestedFrom != null) { - uri.AppendQuery("suggestedFrom", suggestedSourceLanguage, true); + uri.AppendQuery("suggestedFrom", suggestedFrom, true); } - if (sourceLanguageScript != null) + if (fromScript != null) { - uri.AppendQuery("fromScript", sourceLanguageScript, true); + uri.AppendQuery("fromScript", fromScript, true); } - if (targetLanguageScript != null) + if (toScript != null) { - uri.AppendQuery("toScript", targetLanguageScript, true); + uri.AppendQuery("toScript", toScript, true); } if (allowFallback != null) { @@ -323,7 +323,7 @@ internal HttpMessage CreateTranslateRequest(IEnumerable targetLanguages, return message; } - internal HttpMessage CreateTransliterateRequest(string language, string sourceLanguageScript, string targetLanguageScript, RequestContent content, string clientTraceId, RequestContext context) + internal HttpMessage CreateTransliterateRequest(string language, string fromScript, string toScript, RequestContent content, string clientTraceId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -332,8 +332,8 @@ internal HttpMessage CreateTransliterateRequest(string language, string sourceLa uri.Reset(_endpoint); uri.AppendPath("/transliterate", false); uri.AppendQuery("language", language, true); - uri.AppendQuery("fromScript", sourceLanguageScript, true); - uri.AppendQuery("toScript", targetLanguageScript, true); + uri.AppendQuery("fromScript", fromScript, true); + uri.AppendQuery("toScript", toScript, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -374,7 +374,7 @@ internal HttpMessage CreateFindSentenceBoundariesRequest(RequestContent content, return message; } - internal HttpMessage CreateLookupDictionaryEntriesRequest(string sourceLanguage, string targetLanguage, RequestContent content, string clientTraceId, RequestContext context) + internal HttpMessage CreateLookupDictionaryEntriesRequest(string @from, string to, RequestContent content, string clientTraceId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -382,8 +382,8 @@ internal HttpMessage CreateLookupDictionaryEntriesRequest(string sourceLanguage, var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/dictionary/lookup", false); - uri.AppendQuery("from", sourceLanguage, true); - uri.AppendQuery("to", targetLanguage, true); + uri.AppendQuery("from", @from, true); + uri.AppendQuery("to", to, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -396,7 +396,7 @@ internal HttpMessage CreateLookupDictionaryEntriesRequest(string sourceLanguage, return message; } - internal HttpMessage CreateLookupDictionaryExamplesRequest(string sourceLanguage, string targetLanguage, RequestContent content, string clientTraceId, RequestContext context) + internal HttpMessage CreateLookupDictionaryExamplesRequest(string @from, string to, RequestContent content, string clientTraceId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -404,8 +404,8 @@ internal HttpMessage CreateLookupDictionaryExamplesRequest(string sourceLanguage var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/dictionary/examples", false); - uri.AppendQuery("from", sourceLanguage, true); - uri.AppendQuery("to", targetLanguage, true); + uri.AppendQuery("from", @from, true); + uri.AppendQuery("to", to, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.Serialization.cs index 52e1f1788c7b..8c321db27a54 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.Serialization.cs @@ -27,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteStartObject(); writer.WritePropertyName("proj"u8); - writer.WriteStringValue(Projections); + writer.WriteStringValue(Proj); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.cs index 410a73875cfe..0d697a283a56 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslatedTextAlignment.cs @@ -46,7 +46,7 @@ public partial class TranslatedTextAlignment private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// + /// /// Maps input text to translated text. The alignment information is only provided when the request /// parameter includeAlignment is true. Alignment is returned as a string value of the following /// format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. @@ -54,16 +54,16 @@ public partial class TranslatedTextAlignment /// One word may align with zero, one, or multiple words in the other language, and the aligned words may /// be non-contiguous. When no alignment information is available, the alignment element will be empty. /// - /// is null. - internal TranslatedTextAlignment(string projections) + /// is null. + internal TranslatedTextAlignment(string proj) { - Argument.AssertNotNull(projections, nameof(projections)); + Argument.AssertNotNull(proj, nameof(proj)); - Projections = projections; + Proj = proj; } /// Initializes a new instance of . - /// + /// /// Maps input text to translated text. The alignment information is only provided when the request /// parameter includeAlignment is true. Alignment is returned as a string value of the following /// format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. @@ -72,9 +72,9 @@ internal TranslatedTextAlignment(string projections) /// be non-contiguous. When no alignment information is available, the alignment element will be empty. /// /// Keeps track of any properties unknown to the library. - internal TranslatedTextAlignment(string projections, IDictionary serializedAdditionalRawData) + internal TranslatedTextAlignment(string proj, IDictionary serializedAdditionalRawData) { - Projections = projections; + Proj = proj; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,6 +91,6 @@ internal TranslatedTextAlignment() /// One word may align with zero, one, or multiple words in the other language, and the aligned words may /// be non-contiguous. When no alignment information is available, the alignment element will be empty. /// - public string Projections { get; } + public string Proj { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.Serialization.cs index c03c08bda87d..97faacac24bc 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.Serialization.cs @@ -31,7 +31,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("nativeName"u8); writer.WriteStringValue(NativeName); writer.WritePropertyName("dir"u8); - writer.WriteStringValue(Directionality.ToSerialString()); + writer.WriteStringValue(Dir.ToSerialString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.cs index 9fe1669f9945..3f73d4dfb717 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationLanguage.cs @@ -51,28 +51,28 @@ public partial class TranslationLanguage /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// or is null. - internal TranslationLanguage(string name, string nativeName, LanguageDirectionality directionality) + internal TranslationLanguage(string name, string nativeName, LanguageDirectionality dir) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(nativeName, nameof(nativeName)); Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; } /// Initializes a new instance of . /// Display name of the language in the locale requested via Accept-Language header. /// Display name of the language in the locale native for this language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Keeps track of any properties unknown to the library. - internal TranslationLanguage(string name, string nativeName, LanguageDirectionality directionality, IDictionary serializedAdditionalRawData) + internal TranslationLanguage(string name, string nativeName, LanguageDirectionality dir, IDictionary serializedAdditionalRawData) { Name = name; NativeName = nativeName; - Directionality = directionality; + Dir = dir; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,6 +86,6 @@ internal TranslationLanguage() /// Display name of the language in the locale native for this language. public string NativeName { get; } /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - public LanguageDirectionality Directionality { get; } + public LanguageDirectionality Dir { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.Serialization.cs index 659eb6e7e860..2a8970b762a4 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.Serialization.cs @@ -27,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteStartObject(); writer.WritePropertyName("to"u8); - writer.WriteStringValue(TargetLanguage); + writer.WriteStringValue(To); writer.WritePropertyName("text"u8); writer.WriteStringValue(Text); if (Optional.IsDefined(Transliteration)) @@ -40,10 +40,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WritePropertyName("alignment"u8); writer.WriteObjectValue(Alignment, options); } - if (Optional.IsDefined(SentenceBoundaries)) + if (Optional.IsDefined(SentLen)) { writer.WritePropertyName("sentLen"u8); - writer.WriteObjectValue(SentenceBoundaries, options); + writer.WriteObjectValue(SentLen, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.cs index e283bbf676d4..ea46814957e7 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TranslationText.cs @@ -46,32 +46,32 @@ public partial class TranslationText private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// A string representing the language code of the target language. + /// A string representing the language code of the target language. /// A string giving the translated text. - /// or is null. - internal TranslationText(string targetLanguage, string text) + /// or is null. + internal TranslationText(string to, string text) { - Argument.AssertNotNull(targetLanguage, nameof(targetLanguage)); + Argument.AssertNotNull(to, nameof(to)); Argument.AssertNotNull(text, nameof(text)); - TargetLanguage = targetLanguage; + To = to; Text = text; } /// Initializes a new instance of . - /// A string representing the language code of the target language. + /// A string representing the language code of the target language. /// A string giving the translated text. /// An object giving the translated text in the script specified by the toScript parameter. /// Alignment information. - /// Sentence boundaries in the input and output texts. + /// Sentence boundaries in the input and output texts. /// Keeps track of any properties unknown to the library. - internal TranslationText(string targetLanguage, string text, TransliteratedText transliteration, TranslatedTextAlignment alignment, SentenceBoundaries sentenceBoundaries, IDictionary serializedAdditionalRawData) + internal TranslationText(string to, string text, TransliteratedText transliteration, TranslatedTextAlignment alignment, SentenceBoundaries sentLen, IDictionary serializedAdditionalRawData) { - TargetLanguage = targetLanguage; + To = to; Text = text; Transliteration = transliteration; Alignment = alignment; - SentenceBoundaries = sentenceBoundaries; + SentLen = sentLen; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -81,7 +81,7 @@ internal TranslationText() } /// A string representing the language code of the target language. - public string TargetLanguage { get; } + public string To { get; } /// A string giving the translated text. public string Text { get; } /// An object giving the translated text in the script specified by the toScript parameter. @@ -89,6 +89,6 @@ internal TranslationText() /// Alignment information. public TranslatedTextAlignment Alignment { get; } /// Sentence boundaries in the input and output texts. - public SentenceBoundaries SentenceBoundaries { get; } + public SentenceBoundaries SentLen { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.Serialization.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.Serialization.cs index 8836675f3d4a..764b68d7c56f 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.Serialization.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.Serialization.cs @@ -28,7 +28,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteStartObject(); writer.WritePropertyName("toScripts"u8); writer.WriteStartArray(); - foreach (var item in TargetLanguageScripts) + foreach (var item in ToScripts) { writer.WriteObjectValue(item, options); } @@ -40,7 +40,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("nativeName"u8); writer.WriteStringValue(NativeName); writer.WritePropertyName("dir"u8); - writer.WriteStringValue(Directionality.ToSerialString()); + writer.WriteStringValue(Dir.ToSerialString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.cs b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.cs index 24de9ee02a96..9297e7b27e47 100644 --- a/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.cs +++ b/sdk/translation/Azure.AI.Translation.Text/src/Generated/TransliterableScript.cs @@ -18,29 +18,29 @@ public partial class TransliterableScript : LanguageScript /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. - /// List of scripts available to convert text to. - /// , , or is null. - internal TransliterableScript(string code, string name, string nativeName, LanguageDirectionality directionality, IEnumerable targetLanguageScripts) : base(code, name, nativeName, directionality) + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// List of scripts available to convert text to. + /// , , or is null. + internal TransliterableScript(string code, string name, string nativeName, LanguageDirectionality dir, IEnumerable toScripts) : base(code, name, nativeName, dir) { Argument.AssertNotNull(code, nameof(code)); Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(nativeName, nameof(nativeName)); - Argument.AssertNotNull(targetLanguageScripts, nameof(targetLanguageScripts)); + Argument.AssertNotNull(toScripts, nameof(toScripts)); - TargetLanguageScripts = targetLanguageScripts.ToList(); + ToScripts = toScripts.ToList(); } /// Initializes a new instance of . /// Code identifying the script. /// Display name of the script in the locale requested via Accept-Language header. /// Display name of the language in the locale native for the language. - /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. + /// Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages. /// Keeps track of any properties unknown to the library. - /// List of scripts available to convert text to. - internal TransliterableScript(string code, string name, string nativeName, LanguageDirectionality directionality, IDictionary serializedAdditionalRawData, IReadOnlyList targetLanguageScripts) : base(code, name, nativeName, directionality, serializedAdditionalRawData) + /// List of scripts available to convert text to. + internal TransliterableScript(string code, string name, string nativeName, LanguageDirectionality dir, IDictionary serializedAdditionalRawData, IReadOnlyList toScripts) : base(code, name, nativeName, dir, serializedAdditionalRawData) { - TargetLanguageScripts = targetLanguageScripts; + ToScripts = toScripts; } /// Initializes a new instance of for deserialization. @@ -49,6 +49,6 @@ internal TransliterableScript() } /// List of scripts available to convert text to. - public IReadOnlyList TargetLanguageScripts { get; } + public IReadOnlyList ToScripts { get; } } } diff --git a/sdk/translation/Azure.AI.Translation.Text/tsp-location.yaml b/sdk/translation/Azure.AI.Translation.Text/tsp-location.yaml index da41a8211de5..438feeb60ca0 100644 --- a/sdk/translation/Azure.AI.Translation.Text/tsp-location.yaml +++ b/sdk/translation/Azure.AI.Translation.Text/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/translation/Azure.AI.TextTranslation -commit: cc6917418740a76c0c1b5be595a89f279df73bf6 -repo: Azure/azure-rest-api-specs +commit: 564bc134700944a7c4372730f23a15c86c46be26 +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/autorest.md b/sdk/workloads/Azure.ResourceManager.Workloads/src/autorest.md index 509de9a74675..c1f6401088c4 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/autorest.md +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: Workloads namespace: Azure.ResourceManager.Workloads -require: https://github.com/Azure/azure-rest-api-specs/blob/c9a6e0a98a51ebc0c7a346f4fd425ba185f44b31/specification/workloads/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/workloads/resource-manager/readme.md tag: package-2023-04 output-folder: $(this-folder)/Generated clear-output-folder: true