/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// title (required) - string - Internal reference for key. /// public_key (required) - string - Actual contents of SSH key. /// </summary> public static async Task <PublicKey> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("title") && !(parameters["title"] is string)) { throw new ArgumentException("Bad parameter: title must be of type string", "parameters[\"title\"]"); } if (parameters.ContainsKey("public_key") && !(parameters["public_key"] is string)) { throw new ArgumentException("Bad parameter: public_key must be of type string", "parameters[\"public_key\"]"); } if (!parameters.ContainsKey("title") || parameters["title"] == null) { throw new ArgumentNullException("Parameter missing: title", "parameters[\"title\"]"); } if (!parameters.ContainsKey("public_key") || parameters["public_key"] == null) { throw new ArgumentNullException("Parameter missing: public_key", "parameters[\"public_key\"]"); } string responseJson = await FilesClient.SendRequest($"/public_keys", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <PublicKey>(responseJson)); }
/// <summary> /// Parameters: /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `destination`. /// mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.) /// path - string - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory. /// </summary> public static async Task <Request[]> List( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("sort_by") && !(parameters["sort_by"] is object)) { throw new ArgumentException("Bad parameter: sort_by must be of type object", "parameters[\"sort_by\"]"); } if (parameters.ContainsKey("mine") && !(parameters["mine"] is bool)) { throw new ArgumentException("Bad parameter: mine must be of type bool", "parameters[\"mine\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } string responseJson = await FilesClient.SendRequest($"/requests", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <Request[]>(responseJson)); }
/// <summary> /// Parameters: /// username - string - Username to sign in as /// password - string - Password for sign in /// otp - string - If this user has a 2FA device, provide its OTP or code here. /// partial_session_id - string - Identifier for a partially-completed login /// </summary> public static async Task <Session> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("username") && !(parameters["username"] is string)) { throw new ArgumentException("Bad parameter: username must be of type string", "parameters[\"username\"]"); } if (parameters.ContainsKey("password") && !(parameters["password"] is string)) { throw new ArgumentException("Bad parameter: password must be of type string", "parameters[\"password\"]"); } if (parameters.ContainsKey("otp") && !(parameters["otp"] is string)) { throw new ArgumentException("Bad parameter: otp must be of type string", "parameters[\"otp\"]"); } if (parameters.ContainsKey("partial_session_id") && !(parameters["partial_session_id"] is string)) { throw new ArgumentException("Bad parameter: partial_session_id must be of type string", "parameters[\"partial_session_id\"]"); } string responseJson = await FilesClient.SendRequest($"/sessions", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <Session>(responseJson)); }
/// <summary> /// Send email(s) with a link to bundle /// /// Parameters: /// to - array(string) - A list of email addresses to share this bundle with. Required unless `recipients` is used. /// note - string - Note to include in email. /// recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used. /// </summary> public static async Task <Bundle> Share( Nullable <Int64> id, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("id", id); if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("to") && !(parameters["to"] is string[])) { throw new ArgumentException("Bad parameter: to must be of type string[]", "parameters[\"to\"]"); } if (parameters.ContainsKey("note") && !(parameters["note"] is string)) { throw new ArgumentException("Bad parameter: note must be of type string", "parameters[\"note\"]"); } if (parameters.ContainsKey("recipients") && !(parameters["recipients"] is object[])) { throw new ArgumentException("Bad parameter: recipients must be of type object[]", "parameters[\"recipients\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } string responseJson = await FilesClient.SendRequest($"/bundles/{Uri.EscapeDataString(parameters["id"].ToString())}/share", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <Bundle>(responseJson)); }
/// <summary> /// Parameters: /// name - string - Name of the Clickwrap agreement (used when selecting from multiple Clickwrap agreements.) /// body - string - Body text of Clickwrap (supports Markdown formatting). /// use_with_bundles - string - Use this Clickwrap for Bundles? /// use_with_inboxes - string - Use this Clickwrap for Inboxes? /// use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password. /// </summary> public static async Task <Clickwrap> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("body") && !(parameters["body"] is string)) { throw new ArgumentException("Bad parameter: body must be of type string", "parameters[\"body\"]"); } if (parameters.ContainsKey("use_with_bundles") && !(parameters["use_with_bundles"] is string)) { throw new ArgumentException("Bad parameter: use_with_bundles must be of type string", "parameters[\"use_with_bundles\"]"); } if (parameters.ContainsKey("use_with_inboxes") && !(parameters["use_with_inboxes"] is string)) { throw new ArgumentException("Bad parameter: use_with_inboxes must be of type string", "parameters[\"use_with_inboxes\"]"); } if (parameters.ContainsKey("use_with_users") && !(parameters["use_with_users"] is string)) { throw new ArgumentException("Bad parameter: use_with_users must be of type string", "parameters[\"use_with_users\"]"); } string responseJson = await FilesClient.SendRequest($"/clickwraps", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <Clickwrap>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// project_id (required) - int64 - Project for which to return messages. /// </summary> public static async Task <Message[]> List( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("project_id") && !(parameters["project_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: project_id must be of type Nullable<Int64>", "parameters[\"project_id\"]"); } if (!parameters.ContainsKey("project_id") || parameters["project_id"] == null) { throw new ArgumentNullException("Parameter missing: project_id", "parameters[\"project_id\"]"); } string responseJson = await FilesClient.SendRequest($"/messages", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <Message[]>(responseJson)); }
/// <summary> /// Parameters: /// group_id (required) - int64 - Group ID to add user to. /// user_id (required) - int64 - User ID to add to group. /// admin - boolean - Is the user a group administrator? /// </summary> public static async Task <GroupUser> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("group_id") && !(parameters["group_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: group_id must be of type Nullable<Int64>", "parameters[\"group_id\"]"); } if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("admin") && !(parameters["admin"] is bool)) { throw new ArgumentException("Bad parameter: admin must be of type bool", "parameters[\"admin\"]"); } if (!parameters.ContainsKey("group_id") || parameters["group_id"] == null) { throw new ArgumentNullException("Parameter missing: group_id", "parameters[\"group_id\"]"); } if (!parameters.ContainsKey("user_id") || parameters["user_id"] == null) { throw new ArgumentNullException("Parameter missing: user_id", "parameters[\"user_id\"]"); } string responseJson = await FilesClient.SendRequest($"/group_users", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <GroupUser>(responseJson)); }
/// <summary> /// Parameters: /// global_access (required) - string - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. /// </summary> public async Task <Project> Update(Dictionary <string, object> parameters) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); parameters["id"] = attributes["id"]; if (!attributes.ContainsKey("id")) { throw new ArgumentException("Current object doesn't have a id"); } if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("global_access") && !(parameters["global_access"] is string)) { throw new ArgumentException("Bad parameter: global_access must be of type string", "parameters[\"global_access\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } if (!parameters.ContainsKey("global_access") || parameters["global_access"] == null) { throw new ArgumentNullException("Parameter missing: global_access", "parameters[\"global_access\"]"); } string responseJson = await FilesClient.SendRequest($"/projects/{Uri.EscapeDataString(attributes["id"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <Project>(responseJson)); }
/// <summary> /// Parameters: /// name - string - AS2 Name /// uri - string - URL base for AS2 responses /// public_certificate - string /// </summary> public static async Task <As2Partner> Update( Nullable <Int64> id, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("id", id); if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("uri") && !(parameters["uri"] is string)) { throw new ArgumentException("Bad parameter: uri must be of type string", "parameters[\"uri\"]"); } if (parameters.ContainsKey("public_certificate") && !(parameters["public_certificate"] is string)) { throw new ArgumentException("Bad parameter: public_certificate must be of type string", "parameters[\"public_certificate\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } string responseJson = await FilesClient.SendRequest($"/as2_partners/{Uri.EscapeDataString(parameters["id"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <As2Partner>(responseJson)); }
/// <summary> /// Parameters: /// name - string - Internal name for the API Key. For your use. /// expires_at - string - API Key expiration date /// permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know. /// </summary> public async Task <ApiKey> Update(Dictionary <string, object> parameters) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); parameters["id"] = attributes["id"]; if (!attributes.ContainsKey("id")) { throw new ArgumentException("Current object doesn't have a id"); } if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("expires_at") && !(parameters["expires_at"] is string)) { throw new ArgumentException("Bad parameter: expires_at must be of type string", "parameters[\"expires_at\"]"); } if (parameters.ContainsKey("permission_set") && !(parameters["permission_set"] is string)) { throw new ArgumentException("Bad parameter: permission_set must be of type string", "parameters[\"permission_set\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } string responseJson = await FilesClient.SendRequest($"/api_keys/{Uri.EscapeDataString(attributes["id"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <ApiKey>(responseJson)); }
/// <summary> /// Parameters: /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// folder_behavior_id - int64 - ID of the associated Inbox. /// </summary> public static async Task <InboxRegistration[]> List( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("folder_behavior_id") && !(parameters["folder_behavior_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: folder_behavior_id must be of type Nullable<Int64>", "parameters[\"folder_behavior_id\"]"); } string responseJson = await FilesClient.SendRequest($"/inbox_registrations", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <InboxRegistration[]>(responseJson)); }
/// <summary> /// Parameters: /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// path (required) - string - Path to operate on. /// include_children - boolean - Include locks from children objects? /// </summary> public static async Task <Lock[]> ListFor( string path, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("path", path); if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("include_children") && !(parameters["include_children"] is bool)) { throw new ArgumentException("Bad parameter: include_children must be of type bool", "parameters[\"include_children\"]"); } if (!parameters.ContainsKey("path") || parameters["path"] == null) { throw new ArgumentNullException("Parameter missing: path", "parameters[\"path\"]"); } string responseJson = await FilesClient.SendRequest($"/locks/{Uri.EscapeDataString(parameters["path"].ToString())}", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <Lock[]>(responseJson)); }
/// <summary> /// Parameters: /// body (required) - string - Comment body. /// path (required) - string - File path. /// </summary> public static async Task <FileComment> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("body") && !(parameters["body"] is string)) { throw new ArgumentException("Bad parameter: body must be of type string", "parameters[\"body\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (!parameters.ContainsKey("body") || parameters["body"] == null) { throw new ArgumentNullException("Parameter missing: body", "parameters[\"body\"]"); } if (!parameters.ContainsKey("path") || parameters["path"] == null) { throw new ArgumentNullException("Parameter missing: path", "parameters[\"path\"]"); } string responseJson = await FilesClient.SendRequest($"/file_comments", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <FileComment>(responseJson)); }
/// <summary> /// Parameters: /// body (required) - string - Comment body. /// </summary> public static async Task <MessageComment> Update( Nullable <Int64> id, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("id", id); if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("body") && !(parameters["body"] is string)) { throw new ArgumentException("Bad parameter: body must be of type string", "parameters[\"body\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } if (!parameters.ContainsKey("body") || parameters["body"] == null) { throw new ArgumentNullException("Parameter missing: body", "parameters[\"body\"]"); } string responseJson = await FilesClient.SendRequest($"/message_comments/{Uri.EscapeDataString(parameters["id"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <MessageComment>(responseJson)); }
/// <summary> /// Parameters: /// file (required) - file - Logo for custom branding. /// </summary> public static async Task <Style> Update( string path, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("path", path); if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("file") && !(parameters["file"] is System.Net.Http.ByteArrayContent)) { throw new ArgumentException("Bad parameter: file must be of type System.Net.Http.ByteArrayContent", "parameters[\"file\"]"); } if (!parameters.ContainsKey("path") || parameters["path"] == null) { throw new ArgumentNullException("Parameter missing: path", "parameters[\"path\"]"); } if (!parameters.ContainsKey("file") || parameters["file"] == null) { throw new ArgumentNullException("Parameter missing: file", "parameters[\"file\"]"); } string responseJson = await FilesClient.SendRequest($"/styles/{Uri.EscapeDataString(parameters["path"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <Style>(responseJson)); }
/// <summary> /// Parameters: /// token (required) - string - Lock token /// </summary> public static async Task <Lock> Delete( string path, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("path", path); if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("token") && !(parameters["token"] is string)) { throw new ArgumentException("Bad parameter: token must be of type string", "parameters[\"token\"]"); } if (!parameters.ContainsKey("path") || parameters["path"] == null) { throw new ArgumentNullException("Parameter missing: path", "parameters[\"path\"]"); } if (!parameters.ContainsKey("token") || parameters["token"] == null) { throw new ArgumentNullException("Parameter missing: token", "parameters[\"token\"]"); } string responseJson = await FilesClient.SendRequest($"/locks/{Uri.EscapeDataString(parameters["path"].ToString())}", System.Net.Http.HttpMethod.Delete, parameters, options); return(JsonSerializer.Deserialize <Lock>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// emoji (required) - string - Emoji to react with. /// </summary> public static async Task <MessageCommentReaction> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("emoji") && !(parameters["emoji"] is string)) { throw new ArgumentException("Bad parameter: emoji must be of type string", "parameters[\"emoji\"]"); } if (!parameters.ContainsKey("emoji") || parameters["emoji"] == null) { throw new ArgumentNullException("Parameter missing: emoji", "parameters[\"emoji\"]"); } string responseJson = await FilesClient.SendRequest($"/message_comment_reactions", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <MessageCommentReaction>(responseJson)); }
/// <summary> /// Parameters: /// expires_at - string - API Key expiration date /// name - string - Internal name for the API Key. For your use. /// permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know. /// </summary> public static async Task <ApiKey> UpdateCurrent( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("expires_at") && !(parameters["expires_at"] is string)) { throw new ArgumentException("Bad parameter: expires_at must be of type string", "parameters[\"expires_at\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("permission_set") && !(parameters["permission_set"] is string)) { throw new ArgumentException("Bad parameter: permission_set must be of type string", "parameters[\"permission_set\"]"); } string responseJson = await FilesClient.SendRequest($"/api_key", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <ApiKey>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// name - string - Internal name for the API Key. For your use. /// expires_at - string - API Key expiration date /// permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know. /// path - string - Folder path restriction for this api key. /// </summary> public static async Task <ApiKey> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("expires_at") && !(parameters["expires_at"] is string)) { throw new ArgumentException("Bad parameter: expires_at must be of type string", "parameters[\"expires_at\"]"); } if (parameters.ContainsKey("permission_set") && !(parameters["permission_set"] is string)) { throw new ArgumentException("Bad parameter: permission_set must be of type string", "parameters[\"permission_set\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } string responseJson = await FilesClient.SendRequest($"/api_keys", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <ApiKey>(responseJson)); }
/// <summary> /// Parameters: /// name - string - Group name. /// notes - string - Group notes. /// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited. /// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited. /// </summary> public static async Task <Group> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("notes") && !(parameters["notes"] is string)) { throw new ArgumentException("Bad parameter: notes must be of type string", "parameters[\"notes\"]"); } if (parameters.ContainsKey("user_ids") && !(parameters["user_ids"] is string)) { throw new ArgumentException("Bad parameter: user_ids must be of type string", "parameters[\"user_ids\"]"); } if (parameters.ContainsKey("admin_ids") && !(parameters["admin_ids"] is string)) { throw new ArgumentException("Bad parameter: admin_ids must be of type string", "parameters[\"admin_ids\"]"); } string responseJson = await FilesClient.SendRequest($"/groups", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <Group>(responseJson)); }
/// <summary> /// Parameters: /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `created_at`. /// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`. /// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. /// filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `created_at`. /// filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`. /// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. /// filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`. /// bundle_id - int64 - Bundle ID /// bundle_registration_id - int64 - BundleRegistration ID /// </summary> public static async Task <BundleDownload[]> List( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("sort_by") && !(parameters["sort_by"] is object)) { throw new ArgumentException("Bad parameter: sort_by must be of type object", "parameters[\"sort_by\"]"); } if (parameters.ContainsKey("filter") && !(parameters["filter"] is object)) { throw new ArgumentException("Bad parameter: filter must be of type object", "parameters[\"filter\"]"); } if (parameters.ContainsKey("filter_gt") && !(parameters["filter_gt"] is object)) { throw new ArgumentException("Bad parameter: filter_gt must be of type object", "parameters[\"filter_gt\"]"); } if (parameters.ContainsKey("filter_gteq") && !(parameters["filter_gteq"] is object)) { throw new ArgumentException("Bad parameter: filter_gteq must be of type object", "parameters[\"filter_gteq\"]"); } if (parameters.ContainsKey("filter_like") && !(parameters["filter_like"] is object)) { throw new ArgumentException("Bad parameter: filter_like must be of type object", "parameters[\"filter_like\"]"); } if (parameters.ContainsKey("filter_lt") && !(parameters["filter_lt"] is object)) { throw new ArgumentException("Bad parameter: filter_lt must be of type object", "parameters[\"filter_lt\"]"); } if (parameters.ContainsKey("filter_lteq") && !(parameters["filter_lteq"] is object)) { throw new ArgumentException("Bad parameter: filter_lteq must be of type object", "parameters[\"filter_lteq\"]"); } if (parameters.ContainsKey("bundle_id") && !(parameters["bundle_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: bundle_id must be of type Nullable<Int64>", "parameters[\"bundle_id\"]"); } if (parameters.ContainsKey("bundle_registration_id") && !(parameters["bundle_registration_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: bundle_registration_id must be of type Nullable<Int64>", "parameters[\"bundle_registration_id\"]"); } string responseJson = await FilesClient.SendRequest($"/bundle_downloads", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <BundleDownload[]>(responseJson)); }
/// <summary> /// Parameters: /// cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// path (required) - string - Path to operate on. /// filter - string - If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here. /// preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`. /// search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`. /// search_all - boolean - Search entire site? /// with_previews - boolean - Include file previews? /// with_priority_color - boolean - Include file priority color information? /// </summary> public static async Task <RemoteFile[]> ListFor( string path, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("path", path); if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("filter") && !(parameters["filter"] is string)) { throw new ArgumentException("Bad parameter: filter must be of type string", "parameters[\"filter\"]"); } if (parameters.ContainsKey("preview_size") && !(parameters["preview_size"] is string)) { throw new ArgumentException("Bad parameter: preview_size must be of type string", "parameters[\"preview_size\"]"); } if (parameters.ContainsKey("search") && !(parameters["search"] is string)) { throw new ArgumentException("Bad parameter: search must be of type string", "parameters[\"search\"]"); } if (parameters.ContainsKey("search_all") && !(parameters["search_all"] is bool)) { throw new ArgumentException("Bad parameter: search_all must be of type bool", "parameters[\"search_all\"]"); } if (parameters.ContainsKey("with_previews") && !(parameters["with_previews"] is bool)) { throw new ArgumentException("Bad parameter: with_previews must be of type bool", "parameters[\"with_previews\"]"); } if (parameters.ContainsKey("with_priority_color") && !(parameters["with_priority_color"] is bool)) { throw new ArgumentException("Bad parameter: with_priority_color must be of type bool", "parameters[\"with_priority_color\"]"); } if (!parameters.ContainsKey("path") || parameters["path"] == null) { throw new ArgumentNullException("Parameter missing: path", "parameters[\"path\"]"); } string responseJson = await FilesClient.SendRequest($"/folders/{Uri.EscapeDataString(parameters["path"].ToString())}", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <RemoteFile[]>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// start_at - string - Start date/time of export range. /// end_at - string - End date/time of export range. /// query_message - string - Error message associated with the request, if any. /// query_request_method - string - The HTTP request method used by the webhook. /// query_request_url - string - The target webhook URL. /// query_status - string - The HTTP status returned from the server in response to the webhook request. /// query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. /// query_path - string - Return notifications that were triggered by actions on this specific path. /// query_folder - string - Return notifications that were triggered by actions in this folder. /// </summary> public static async Task <ActionNotificationExport> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("start_at") && !(parameters["start_at"] is string)) { throw new ArgumentException("Bad parameter: start_at must be of type string", "parameters[\"start_at\"]"); } if (parameters.ContainsKey("end_at") && !(parameters["end_at"] is string)) { throw new ArgumentException("Bad parameter: end_at must be of type string", "parameters[\"end_at\"]"); } if (parameters.ContainsKey("query_message") && !(parameters["query_message"] is string)) { throw new ArgumentException("Bad parameter: query_message must be of type string", "parameters[\"query_message\"]"); } if (parameters.ContainsKey("query_request_method") && !(parameters["query_request_method"] is string)) { throw new ArgumentException("Bad parameter: query_request_method must be of type string", "parameters[\"query_request_method\"]"); } if (parameters.ContainsKey("query_request_url") && !(parameters["query_request_url"] is string)) { throw new ArgumentException("Bad parameter: query_request_url must be of type string", "parameters[\"query_request_url\"]"); } if (parameters.ContainsKey("query_status") && !(parameters["query_status"] is string)) { throw new ArgumentException("Bad parameter: query_status must be of type string", "parameters[\"query_status\"]"); } if (parameters.ContainsKey("query_success") && !(parameters["query_success"] is bool)) { throw new ArgumentException("Bad parameter: query_success must be of type bool", "parameters[\"query_success\"]"); } if (parameters.ContainsKey("query_path") && !(parameters["query_path"] is string)) { throw new ArgumentException("Bad parameter: query_path must be of type string", "parameters[\"query_path\"]"); } if (parameters.ContainsKey("query_folder") && !(parameters["query_folder"] is string)) { throw new ArgumentException("Bad parameter: query_folder must be of type string", "parameters[\"query_folder\"]"); } string responseJson = await FilesClient.SendRequest($"/action_notification_exports", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <ActionNotificationExport>(responseJson)); }
/// <summary> /// Parameters: /// url (required) - string - URL for testing the webhook. /// method - string - HTTP method(GET or POST). /// encoding - string - HTTP encoding method. Can be JSON, XML, or RAW (form data). /// headers - object - Additional request headers. /// body - object - Additional body parameters. /// raw_body - string - raw body text /// file_as_body - boolean - Send the file data as the request body? /// file_form_field - string - Send the file data as a named parameter in the request POST body /// action - string - action for test body /// </summary> public static async Task <WebhookTest> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("url") && !(parameters["url"] is string)) { throw new ArgumentException("Bad parameter: url must be of type string", "parameters[\"url\"]"); } if (parameters.ContainsKey("method") && !(parameters["method"] is string)) { throw new ArgumentException("Bad parameter: method must be of type string", "parameters[\"method\"]"); } if (parameters.ContainsKey("encoding") && !(parameters["encoding"] is string)) { throw new ArgumentException("Bad parameter: encoding must be of type string", "parameters[\"encoding\"]"); } if (parameters.ContainsKey("headers") && !(parameters["headers"] is object)) { throw new ArgumentException("Bad parameter: headers must be of type object", "parameters[\"headers\"]"); } if (parameters.ContainsKey("body") && !(parameters["body"] is object)) { throw new ArgumentException("Bad parameter: body must be of type object", "parameters[\"body\"]"); } if (parameters.ContainsKey("raw_body") && !(parameters["raw_body"] is string)) { throw new ArgumentException("Bad parameter: raw_body must be of type string", "parameters[\"raw_body\"]"); } if (parameters.ContainsKey("file_as_body") && !(parameters["file_as_body"] is bool)) { throw new ArgumentException("Bad parameter: file_as_body must be of type bool", "parameters[\"file_as_body\"]"); } if (parameters.ContainsKey("file_form_field") && !(parameters["file_form_field"] is string)) { throw new ArgumentException("Bad parameter: file_form_field must be of type string", "parameters[\"file_form_field\"]"); } if (parameters.ContainsKey("action") && !(parameters["action"] is string)) { throw new ArgumentException("Bad parameter: action must be of type string", "parameters[\"action\"]"); } if (!parameters.ContainsKey("url") || parameters["url"] == null) { throw new ArgumentNullException("Parameter missing: url", "parameters[\"url\"]"); } string responseJson = await FilesClient.SendRequest($"/webhook_tests", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <WebhookTest>(responseJson)); }
/// <summary> /// Parameters: /// name (required) - string - AS2 Name /// domain (required) - string - AS2 Domain /// uri (required) - string - URL base for AS2 responses /// public_certificate (required) - string /// private_key (required) - string /// </summary> public static async Task <As2Station> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("domain") && !(parameters["domain"] is string)) { throw new ArgumentException("Bad parameter: domain must be of type string", "parameters[\"domain\"]"); } if (parameters.ContainsKey("uri") && !(parameters["uri"] is string)) { throw new ArgumentException("Bad parameter: uri must be of type string", "parameters[\"uri\"]"); } if (parameters.ContainsKey("public_certificate") && !(parameters["public_certificate"] is string)) { throw new ArgumentException("Bad parameter: public_certificate must be of type string", "parameters[\"public_certificate\"]"); } if (parameters.ContainsKey("private_key") && !(parameters["private_key"] is string)) { throw new ArgumentException("Bad parameter: private_key must be of type string", "parameters[\"private_key\"]"); } if (!parameters.ContainsKey("name") || parameters["name"] == null) { throw new ArgumentNullException("Parameter missing: name", "parameters[\"name\"]"); } if (!parameters.ContainsKey("domain") || parameters["domain"] == null) { throw new ArgumentNullException("Parameter missing: domain", "parameters[\"domain\"]"); } if (!parameters.ContainsKey("uri") || parameters["uri"] == null) { throw new ArgumentNullException("Parameter missing: uri", "parameters[\"uri\"]"); } if (!parameters.ContainsKey("public_certificate") || parameters["public_certificate"] == null) { throw new ArgumentNullException("Parameter missing: public_certificate", "parameters[\"public_certificate\"]"); } if (!parameters.ContainsKey("private_key") || parameters["private_key"] == null) { throw new ArgumentNullException("Parameter missing: private_key", "parameters[\"private_key\"]"); } string responseJson = await FilesClient.SendRequest($"/as2_stations", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <As2Station>(responseJson)); }
/// <summary> /// Parameters: /// value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior. /// attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image /// name - string - Name for this behavior. /// description - string - Description for this behavior. /// behavior - string - Behavior type. /// path - string - Folder behaviors path. /// attachment_delete - boolean - If true, will delete the file stored in attachment /// </summary> public static async Task <Behavior> Update( Nullable <Int64> id, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("id", id); if (parameters.ContainsKey("id") && !(parameters["id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: id must be of type Nullable<Int64>", "parameters[\"id\"]"); } if (parameters.ContainsKey("value") && !(parameters["value"] is string)) { throw new ArgumentException("Bad parameter: value must be of type string", "parameters[\"value\"]"); } if (parameters.ContainsKey("attachment_file") && !(parameters["attachment_file"] is System.Net.Http.ByteArrayContent)) { throw new ArgumentException("Bad parameter: attachment_file must be of type System.Net.Http.ByteArrayContent", "parameters[\"attachment_file\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("description") && !(parameters["description"] is string)) { throw new ArgumentException("Bad parameter: description must be of type string", "parameters[\"description\"]"); } if (parameters.ContainsKey("behavior") && !(parameters["behavior"] is string)) { throw new ArgumentException("Bad parameter: behavior must be of type string", "parameters[\"behavior\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("attachment_delete") && !(parameters["attachment_delete"] is bool)) { throw new ArgumentException("Bad parameter: attachment_delete must be of type bool", "parameters[\"attachment_delete\"]"); } if (!parameters.ContainsKey("id") || parameters["id"] == null) { throw new ArgumentNullException("Parameter missing: id", "parameters[\"id\"]"); } string responseJson = await FilesClient.SendRequest($"/behaviors/{Uri.EscapeDataString(parameters["id"].ToString())}", new HttpMethod("PATCH"), parameters, options); return(JsonSerializer.Deserialize <Behavior>(responseJson)); }
/// <summary> /// </summary> public static async Task <ApiKey> DeleteCurrent( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); string responseJson = await FilesClient.SendRequest($"/api_key", System.Net.Http.HttpMethod.Delete, parameters, options); return(JsonSerializer.Deserialize <ApiKey>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user. /// inbox_id (required) - int64 - Inbox to share. /// recipient (required) - string - Email address to share this inbox with. /// name - string - Name of recipient. /// company - string - Company of recipient. /// note - string - Note to include in email. /// share_after_create - boolean - Set to true to share the link with the recipient upon creation. /// </summary> public static async Task <InboxRecipient> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("inbox_id") && !(parameters["inbox_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: inbox_id must be of type Nullable<Int64>", "parameters[\"inbox_id\"]"); } if (parameters.ContainsKey("recipient") && !(parameters["recipient"] is string)) { throw new ArgumentException("Bad parameter: recipient must be of type string", "parameters[\"recipient\"]"); } if (parameters.ContainsKey("name") && !(parameters["name"] is string)) { throw new ArgumentException("Bad parameter: name must be of type string", "parameters[\"name\"]"); } if (parameters.ContainsKey("company") && !(parameters["company"] is string)) { throw new ArgumentException("Bad parameter: company must be of type string", "parameters[\"company\"]"); } if (parameters.ContainsKey("note") && !(parameters["note"] is string)) { throw new ArgumentException("Bad parameter: note must be of type string", "parameters[\"note\"]"); } if (parameters.ContainsKey("share_after_create") && !(parameters["share_after_create"] is bool)) { throw new ArgumentException("Bad parameter: share_after_create must be of type bool", "parameters[\"share_after_create\"]"); } if (!parameters.ContainsKey("inbox_id") || parameters["inbox_id"] == null) { throw new ArgumentNullException("Parameter missing: inbox_id", "parameters[\"inbox_id\"]"); } if (!parameters.ContainsKey("recipient") || parameters["recipient"] == null) { throw new ArgumentNullException("Parameter missing: recipient", "parameters[\"recipient\"]"); } string responseJson = await FilesClient.SendRequest($"/inbox_recipients", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <InboxRecipient>(responseJson)); }
/// <summary> /// Parameters: /// start_at - string - Leave blank or set to a date/time to filter earlier entries. /// end_at - string - Leave blank or set to a date/time to filter later entries. /// display - string - Display format. Leave blank or set to `full` or `parent`. /// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header. /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). /// sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `user_id` and `created_at`. /// user_id (required) - int64 - User ID. /// </summary> public static async Task <Action[]> ListForUser( Nullable <Int64> user_id, Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); parameters.Add("user_id", user_id); if (parameters.ContainsKey("start_at") && !(parameters["start_at"] is string)) { throw new ArgumentException("Bad parameter: start_at must be of type string", "parameters[\"start_at\"]"); } if (parameters.ContainsKey("end_at") && !(parameters["end_at"] is string)) { throw new ArgumentException("Bad parameter: end_at must be of type string", "parameters[\"end_at\"]"); } if (parameters.ContainsKey("display") && !(parameters["display"] is string)) { throw new ArgumentException("Bad parameter: display must be of type string", "parameters[\"display\"]"); } if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) { throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); } if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); } if (parameters.ContainsKey("sort_by") && !(parameters["sort_by"] is object)) { throw new ArgumentException("Bad parameter: sort_by must be of type object", "parameters[\"sort_by\"]"); } if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (!parameters.ContainsKey("user_id") || parameters["user_id"] == null) { throw new ArgumentNullException("Parameter missing: user_id", "parameters[\"user_id\"]"); } string responseJson = await FilesClient.SendRequest($"/history/users/{Uri.EscapeDataString(parameters["user_id"].ToString())}", System.Net.Http.HttpMethod.Get, parameters, options); return(JsonSerializer.Deserialize <Action[]>(responseJson)); }
/// <summary> /// Parameters: /// user_id - int64 - The id of the user to notify. Provide `user_id`, `username` or `group_id`. /// notify_on_copy - boolean - If `true`, copying or moving resources into this path will trigger a notification, in addition to just uploads. /// notify_user_actions - boolean - If `true` actions initiated by the user will still result in a notification /// recursive - boolean - If `true`, enable notifications for each subfolder in this path /// send_interval - string - The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`. /// group_id - int64 - The ID of the group to notify. Provide `user_id`, `username` or `group_id`. /// path - string - Path /// username - string - The username of the user to notify. Provide `user_id`, `username` or `group_id`. /// </summary> public static async Task <Notification> Create( Dictionary <string, object> parameters = null, Dictionary <string, object> options = null ) { parameters = parameters != null ? parameters : new Dictionary <string, object>(); options = options != null ? options : new Dictionary <string, object>(); if (parameters.ContainsKey("user_id") && !(parameters["user_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: user_id must be of type Nullable<Int64>", "parameters[\"user_id\"]"); } if (parameters.ContainsKey("notify_on_copy") && !(parameters["notify_on_copy"] is bool)) { throw new ArgumentException("Bad parameter: notify_on_copy must be of type bool", "parameters[\"notify_on_copy\"]"); } if (parameters.ContainsKey("notify_user_actions") && !(parameters["notify_user_actions"] is bool)) { throw new ArgumentException("Bad parameter: notify_user_actions must be of type bool", "parameters[\"notify_user_actions\"]"); } if (parameters.ContainsKey("recursive") && !(parameters["recursive"] is bool)) { throw new ArgumentException("Bad parameter: recursive must be of type bool", "parameters[\"recursive\"]"); } if (parameters.ContainsKey("send_interval") && !(parameters["send_interval"] is string)) { throw new ArgumentException("Bad parameter: send_interval must be of type string", "parameters[\"send_interval\"]"); } if (parameters.ContainsKey("group_id") && !(parameters["group_id"] is Nullable <Int64>)) { throw new ArgumentException("Bad parameter: group_id must be of type Nullable<Int64>", "parameters[\"group_id\"]"); } if (parameters.ContainsKey("path") && !(parameters["path"] is string)) { throw new ArgumentException("Bad parameter: path must be of type string", "parameters[\"path\"]"); } if (parameters.ContainsKey("username") && !(parameters["username"] is string)) { throw new ArgumentException("Bad parameter: username must be of type string", "parameters[\"username\"]"); } string responseJson = await FilesClient.SendRequest($"/notifications", System.Net.Http.HttpMethod.Post, parameters, options); return(JsonSerializer.Deserialize <Notification>(responseJson)); }