示例#1
0
        /// <summary>
        /// The Update
        /// </summary>
        /// <param name="client">The <see cref="RestClient"/></param>
        /// <param name="schema">The <see cref="UserSchema"/></param>
        public static void Update(RestClient client, UserSchema schema)
        {
            var uri  = string.Format("/user_schemas/{0}", schema.Id);
            var body = new
            {
                description = schema.Description,
                structure   = schema.Structure
            };

            var request = new RestRequest(uri, Method.PUT);

            Rest.Execute <UserSchemaResponse>(client, request, body);
        }
示例#2
0
        /// <summary>
        /// The Create
        /// </summary>
        /// <param name="client">The <see cref="RestClient"/></param>
        /// <param name="schema">The <see cref="UserSchema"/></param>
        /// <returns>The <see cref="UserSchema"/></returns>
        public static UserSchema Create(RestClient client, UserSchema schema)
        {
            var uri     = "/user_schemas";
            var request = new RestRequest(uri, Method.POST);
            var body    = new
            {
                description = schema.Description,
                structure   = schema.Structure
            };

            var result = Rest.Execute <UserSchemaResponse>(client, request, body);

            return(result.Data.Schema);
        }
示例#3
0
 /// <summary>
 /// The Deactivate
 /// </summary>
 /// <param name="userSchemaId">The <see cref="string"/></param>
 public void Deactivate(string userSchemaId)
 {
     UserSchema.Delete(client, userSchemaId, true);
 }
示例#4
0
 /// <summary>
 /// The Delete
 /// </summary>
 /// <param name="userSchemaId">The <see cref="string"/></param>
 public void Delete(string userSchemaId)
 {
     UserSchema.Delete(client, userSchemaId, false);
 }
示例#5
0
 /// <summary>
 /// The List
 /// </summary>
 /// <param name="start">The <see cref="int"/></param>
 /// <param name="limit">The <see cref="int"/></param>
 /// <returns>The <see cref="UserSchemaList"/></returns>
 public UserSchemaList List(int start, int limit)
 {
     return(UserSchema.List(client, start, limit));
 }
示例#6
0
 /// <summary>
 /// The Create
 /// </summary>
 /// <param name="schema">The <see cref="UserSchema"/></param>
 /// <returns>The <see cref="UserSchema"/></returns>
 public UserSchema Create(UserSchema schema)
 {
     return(UserSchema.Create(client, schema));
 }
示例#7
0
 /// <summary>
 /// The Update
 /// </summary>
 /// <param name="schema">The <see cref="UserSchema"/></param>
 public void Update(UserSchema schema)
 {
     UserSchema.Update(client, schema);
 }