Ejemplo n.º 1
0
        public SCIMSchemaBuilder AddAttribute(string name, SCIMSchemaAttributeTypes type, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                              SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                              SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                              SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null,
                                              bool multiValued = false, ICollection <string> defaulValueStr = null, ICollection <int> defaultValueInt = null, List <string> canonicalValues = null)
        {
            var builder = new SCIMSchemaAttributeBuilder(new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name               = name,
                MultiValued        = multiValued,
                CaseExact          = caseExact,
                Required           = required,
                Mutability         = mutability,
                Returned           = returned,
                Uniqueness         = uniqueness,
                Type               = type,
                Description        = description,
                CanonicalValues    = canonicalValues,
                DefaultValueInt    = defaultValueInt == null ? new List <int>() : defaultValueInt,
                DefaultValueString = defaulValueStr == null ? new List <string>() : defaulValueStr
            });

            if (callback != null)
            {
                callback(builder);
            }

            _attributes.Add(builder.Build());
            return(this);
        }
Ejemplo n.º 2
0
 public SCIMSchemaBuilder AddStringAttribute(string name, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                             SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                             SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                             SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null, ICollection <string> defaultValue = null, bool multiValued = false, List <string> canonicalValues = null)
 {
     return(AddAttribute(name, SCIMSchemaAttributeTypes.STRING, callback, caseExact, required, mutability, returned, uniqueness, description, multiValued, defaulValueStr: defaultValue, canonicalValues: canonicalValues));
 }
Ejemplo n.º 3
0
 public SCIMSchemaBuilder AddComplexAttribute(string name, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                              SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                              SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                              SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null, bool multiValued = false)
 {
     return(AddAttribute(name, SCIMSchemaAttributeTypes.COMPLEX, callback, caseExact, required, mutability, returned, uniqueness, description, multiValued));
 }
Ejemplo n.º 4
0
 public SCIMSchemaBuilder AddIntAttribute(string name, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                          SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                          SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                          SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null, ICollection <int> defaultValue = null, bool multiValued = false)
 {
     return(AddAttribute(name, SCIMSchemaAttributeTypes.INTEGER, callback, caseExact, required, mutability, returned, uniqueness, description, multiValued, defaultValueInt: defaultValue));
 }
        public SCIMSchemaAttributeBuilder AddAttribute(SCIMSchema schema, string name, SCIMSchemaAttributeTypes type, Action<SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
            SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
            SCIMSchemaAttributeReturned returned = SCIMSchemaAttributeReturned.DEFAULT,
            SCIMSchemaAttributeUniqueness uniqueness = SCIMSchemaAttributeUniqueness.NONE, string description = null, bool multiValued = false, List<string> canonicalValues = null)
        {
            var fullPath = $"{_fullPath}.{name}";
            var builder = new SCIMSchemaAttributeBuilder(_scimSchemaAttribute.Id, fullPath, schema, new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name = name,
                MultiValued = multiValued,
                CaseExact = caseExact,
                Required = required,
                Mutability = mutability,
                Returned = returned,
                Uniqueness = uniqueness,
                Type = type,
                Description = description,
                CanonicalValues = canonicalValues,
            });
            if (callback != null)
            {
                callback(builder);
            }

            _schema.AddAttribute(builder.Build());
            return this;
        }
        public SCIMSchemaAttributeBuilder AddAttribute(string name, SCIMSchemaAttributeTypes type, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                                       SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                                       SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                                       SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null, bool multiValued = false)
        {
            var builder = new SCIMSchemaAttributeBuilder(new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name        = name,
                MultiValued = multiValued,
                CaseExact   = caseExact,
                Required    = required,
                Mutability  = mutability,
                Returned    = returned,
                Uniqueness  = uniqueness,
                Type        = type,
                Description = description
            });

            if (callback != null)
            {
                callback(builder);
            }

            _scimSchemaAttribute.AddSubAttribute(builder.Build());
            return(this);
        }
 public SCIMSchemaAttributeBuilder SetReturned(SCIMSchemaAttributeReturned returned)
 {
     _scimSchemaAttribute.Returned = returned;
     return this;
 }