Beispiel #1
0
        internal static CommunicationServiceResourceList DeserializeCommunicationServiceResourceList(JsonElement element)
        {
            Optional <IReadOnlyList <CommunicationServiceResourceData> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <CommunicationServiceResourceData> array = new List <CommunicationServiceResourceData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(CommunicationServiceResourceData.DeserializeCommunicationServiceResourceData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new CommunicationServiceResourceList(Optional.ToList(value), nextLink.Value));
        }
Beispiel #2
0
        internal async Task <CommunicationServiceResource> CreateDefaultCommunicationServices(string communicationServiceName, ResourceGroupResource _resourceGroup)
        {
            CommunicationServiceResourceData data = new CommunicationServiceResourceData(ResourceLocation)
            {
                DataLocation = ResourceDataLocation,
            };
            var communicationServiceLro = await _resourceGroup.GetCommunicationServiceResources().CreateOrUpdateAsync(WaitUntil.Completed, communicationServiceName, data);

            return(communicationServiceLro.Value);
        }
Beispiel #3
0
        public async Task CreateCommunicationService()
        {
            #region Snippet:Managing_CommunicationService_CreateAnApplicationDefinition
            CommunicationServiceResourceCollection collection = resourceGroup.GetCommunicationServiceResources();
            string communicationServiceName       = "myCommunicationService";
            CommunicationServiceResourceData data = new CommunicationServiceResourceData("global")
            {
                DataLocation = "UnitedStates",
            };
            ArmOperation <CommunicationServiceResource> communicationServiceLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, communicationServiceName, data);

            CommunicationServiceResource communicationService = communicationServiceLro.Value;
            #endregion Snippet:Managing_CommunicationService_CreateAnApplicationDefinition
        }