示例#1
0
        internal static EmailServiceResourceList DeserializeEmailServiceResourceList(JsonElement element)
        {
            Optional <IReadOnlyList <EmailServiceResourceData> > 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 <EmailServiceResourceData> array = new List <EmailServiceResourceData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(EmailServiceResourceData.DeserializeEmailServiceResourceData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new EmailServiceResourceList(Optional.ToList(value), nextLink.Value));
        }
示例#2
0
        internal async Task <EmailServiceResource> CreateDefaultEmailServices(string emailServiceName, ResourceGroupResource _resourceGroup)
        {
            EmailServiceResourceData data = new EmailServiceResourceData(ResourceLocation)
            {
                DataLocation = ResourceDataLocation,
            };
            var emailServiceLro = await _resourceGroup.GetEmailServiceResources().CreateOrUpdateAsync(WaitUntil.Completed, emailServiceName, data);

            return(emailServiceLro.Value);
        }