internal SasDefinitionItem(string id, string secretId, SasDefinitionAttributes attributes, IReadOnlyDictionary <string, string> tags)
 {
     Id         = id;
     SecretId   = secretId;
     Attributes = attributes;
     Tags       = tags;
 }
示例#2
0
 internal SasDefinitionBundle(string id, string secretId, string templateUri, SasTokenType?sasType, string validityPeriod, SasDefinitionAttributes attributes, IReadOnlyDictionary <string, string> tags)
 {
     Id             = id;
     SecretId       = secretId;
     TemplateUri    = templateUri;
     SasType        = sasType;
     ValidityPeriod = validityPeriod;
     Attributes     = attributes;
     Tags           = tags;
 }
示例#3
0
        internal static SasDefinitionBundle DeserializeSasDefinitionBundle(JsonElement element)
        {
            Optional <string>                  id                 = default;
            Optional <string>                  sid                = default;
            Optional <string>                  templateUri        = default;
            Optional <SasTokenType>            sasType            = default;
            Optional <string>                  validityPeriod     = default;
            Optional <SasDefinitionAttributes> attributes         = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sid"))
                {
                    sid = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("templateUri"))
                {
                    templateUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sasType"))
                {
                    sasType = new SasTokenType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("validityPeriod"))
                {
                    validityPeriod = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    attributes = SasDefinitionAttributes.DeserializeSasDefinitionAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new SasDefinitionBundle(id.Value, sid.Value, templateUri.Value, Optional.ToNullable(sasType), validityPeriod.Value, attributes.Value, Optional.ToDictionary(tags)));
        }
        internal static DeletedSasDefinitionItem DeserializeDeletedSasDefinitionItem(JsonElement element)
        {
            Optional <string>                  recoveryId         = default;
            Optional <DateTimeOffset>          scheduledPurgeDate = default;
            Optional <DateTimeOffset>          deletedDate        = default;
            Optional <string>                  id                 = default;
            Optional <string>                  sid                = default;
            Optional <SasDefinitionAttributes> attributes         = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recoveryId"))
                {
                    recoveryId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("scheduledPurgeDate"))
                {
                    scheduledPurgeDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("deletedDate"))
                {
                    deletedDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sid"))
                {
                    sid = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    attributes = SasDefinitionAttributes.DeserializeSasDefinitionAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new DeletedSasDefinitionItem(id.Value, sid.Value, attributes.Value, Optional.ToDictionary(tags), recoveryId.Value, Optional.ToNullable(scheduledPurgeDate), Optional.ToNullable(deletedDate)));
        }
        internal static SasDefinitionItem DeserializeSasDefinitionItem(JsonElement element)
        {
            Optional <string> id  = default;
            Optional <string> sid = default;
            Optional <SasDefinitionAttributes> attributes         = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sid"))
                {
                    sid = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    attributes = SasDefinitionAttributes.DeserializeSasDefinitionAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new SasDefinitionItem(id.Value, sid.Value, attributes.Value, Optional.ToDictionary(tags)));
        }
示例#6
0
 internal DeletedSasDefinitionItem(string id, string secretId, SasDefinitionAttributes attributes, IReadOnlyDictionary <string, string> tags, string recoveryId, DateTimeOffset?scheduledPurgeDate, DateTimeOffset?deletedDate) : base(id, secretId, attributes, tags)
 {
     RecoveryId         = recoveryId;
     ScheduledPurgeDate = scheduledPurgeDate;
     DeletedDate        = deletedDate;
 }
        internal static DeletedSasDefinitionBundle DeserializeDeletedSasDefinitionBundle(JsonElement element)
        {
            Optional <string>                  recoveryId         = default;
            Optional <DateTimeOffset>          scheduledPurgeDate = default;
            Optional <DateTimeOffset>          deletedDate        = default;
            Optional <string>                  id                 = default;
            Optional <string>                  sid                = default;
            Optional <string>                  templateUri        = default;
            Optional <SasTokenType>            sasType            = default;
            Optional <string>                  validityPeriod     = default;
            Optional <SasDefinitionAttributes> attributes         = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recoveryId"))
                {
                    recoveryId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("scheduledPurgeDate"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    scheduledPurgeDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("deletedDate"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deletedDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sid"))
                {
                    sid = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("templateUri"))
                {
                    templateUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sasType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sasType = new SasTokenType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("validityPeriod"))
                {
                    validityPeriod = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    attributes = SasDefinitionAttributes.DeserializeSasDefinitionAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new DeletedSasDefinitionBundle(id.Value, sid.Value, templateUri.Value, Optional.ToNullable(sasType), validityPeriod.Value, attributes.Value, Optional.ToDictionary(tags), recoveryId.Value, Optional.ToNullable(scheduledPurgeDate), Optional.ToNullable(deletedDate)));
        }
示例#8
0
 internal DeletedSasDefinitionBundle(string id, string secretId, string templateUri, SasTokenType?sasType, string validityPeriod, SasDefinitionAttributes attributes, IReadOnlyDictionary <string, string> tags, string recoveryId, DateTimeOffset?scheduledPurgeDate, DateTimeOffset?deletedDate) : base(id, secretId, templateUri, sasType, validityPeriod, attributes, tags)
 {
     RecoveryId         = recoveryId;
     ScheduledPurgeDate = scheduledPurgeDate;
     DeletedDate        = deletedDate;
 }