├── .gitignore ├── _VERSION ├── examples ├── .gitignore ├── files-cli │ ├── .gitignore │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ ├── log4net.config │ ├── app.config.template │ ├── files-cli.csproj │ ├── Files.cs │ └── Commands │ │ ├── ListUsersCommand.cs │ │ ├── UploadFileCommand.cs │ │ ├── DownloadFileCommand.cs │ │ ├── BaseCommand.cs │ │ └── ShowUserCommand.cs └── examples.sln ├── sdk ├── .gitignore ├── FilesCom │ ├── icon.png │ ├── ResponseError.cs │ ├── FilesCom.csproj │ ├── FilesListEnumerator.cs │ ├── Models │ │ ├── Auto.cs │ │ ├── Image.cs │ │ ├── Errors.cs │ │ ├── FileAction.cs │ │ ├── BundlePath.cs │ │ ├── UsageByTopLevelDir.cs │ │ ├── ShareGroupMember.cs │ │ ├── PaymentLineItem.cs │ │ ├── PublicIpAddress.cs │ │ ├── Preview.cs │ │ └── HolidayRegion.cs │ ├── Util │ │ └── BooleanJsonConverter.cs │ ├── FilesConfiguration.cs │ └── FilesList.cs ├── FilesTests │ ├── FilesTests.csproj │ └── Util │ │ └── PathUtilTest.cs └── Files.com.sln ├── docs ├── Auto.md ├── Image.md ├── Errors.md ├── UsageByTopLevelDir.md ├── FileAction.md ├── BundlePath.md ├── ShareGroupMember.md ├── PublicIpAddress.md ├── PaymentLineItem.md ├── Preview.md ├── AgentPushUpdate.md ├── Status.md ├── FormField.md ├── HolidayRegion.md ├── Priority.md ├── DnsRecord.md ├── FileMigration.md ├── UserSftpClientUse.md ├── Action.md ├── InvoiceLineItem.md ├── Session.md ├── FileCommentReaction.md ├── SettingsChange.md ├── WebhookTest.md ├── AccountLineItem.md ├── FileUploadPart.md ├── ScimLog.md ├── InboxRegistration.md ├── RemoteBandwidthSnapshot.md ├── Style.md ├── ActionNotificationExportResult.md ├── InboxRecipient.md ├── BundleRegistration.md ├── BandwidthSnapshot.md ├── InboxUpload.md ├── BundleDownload.md ├── UserRequest.md ├── MessageReaction.md ├── UserCipherUse.md ├── BundleRecipient.md ├── EmailLog.md ├── EmailIncomingMessage.md ├── MessageCommentReaction.md ├── Invoice.md ├── Payment.md ├── FileComment.md ├── Project.md ├── RemoteServerConfigurationFile.md ├── UsageSnapshot.md ├── Lock.md ├── AutomationRun.md ├── ActionNotificationExport.md ├── UsageDailySnapshot.md ├── IpAddress.md ├── SftpHostKey.md ├── BundleAction.md ├── App.md ├── MessageComment.md ├── GroupUser.md ├── KeyLifecycleRule.md ├── ShareGroup.md └── Message.md ├── test.sh ├── CONTRIBUTORS ├── shared ├── header_test_data.json ├── url_test_data.json └── normalization_for_comparison_test_data.json ├── SECURITY.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | -------------------------------------------------------------------------------- /_VERSION: -------------------------------------------------------------------------------- 1 | 1.4.343 2 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | -------------------------------------------------------------------------------- /sdk/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | obj/ 3 | bin/ 4 | *.nupkg 5 | -------------------------------------------------------------------------------- /examples/files-cli/.gitignore: -------------------------------------------------------------------------------- 1 | app.config 2 | bin/ 3 | obj/ 4 | -------------------------------------------------------------------------------- /sdk/FilesCom/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Files-com/files-sdk-dotnet/HEAD/sdk/FilesCom/icon.png -------------------------------------------------------------------------------- /docs/Auto.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Auto 2 | 3 | ## Example Auto Object 4 | 5 | ``` 6 | { 7 | "dynamic": null 8 | } 9 | ``` 10 | 11 | * `dynamic` / `Dynamic` (object): 12 | -------------------------------------------------------------------------------- /examples/files-cli/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] 5 | -------------------------------------------------------------------------------- /examples/files-cli/README.md: -------------------------------------------------------------------------------- 1 | # Files.com .NET CLI Example 2 | 3 | The .NET CLI Example demonstrates how a console application should utilize the Files.com API 4 | 5 | 6 | ## Operation 7 | 8 | The CLI functions as a basic command-line tool. 9 | 10 | -------------------------------------------------------------------------------- /docs/Image.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Image 2 | 3 | ## Example Image Object 4 | 5 | ``` 6 | { 7 | "name": "My logo", 8 | "uri": "https://mysite.files.com/.../my_image.png" 9 | } 10 | ``` 11 | 12 | * `name` / `Name` (string): Image name 13 | * `uri` / `Uri` (string): Image URI 14 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export DOTNET_CLI_TELEMETRY_OPTOUT=1 4 | export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 5 | 6 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 7 | cd "${DIR}/sdk" || exit 1 8 | dotnet test || exit 1 9 | cd ../ || exit 1 10 | -------------------------------------------------------------------------------- /docs/Errors.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Errors 2 | 3 | ## Example Errors Object 4 | 5 | ``` 6 | { 7 | "fields": [ 8 | 9 | ], 10 | "messages": [ 11 | 12 | ] 13 | } 14 | ``` 15 | 16 | * `fields` / `Fields` (string[]): A list of fields where errors occur 17 | * `messages` / `Messages` (string[]): A list of error messages 18 | -------------------------------------------------------------------------------- /docs/UsageByTopLevelDir.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UsageByTopLevelDir 2 | 3 | ## Example UsageByTopLevelDir Object 4 | 5 | ``` 6 | { 7 | "dir": "", 8 | "size": 1, 9 | "count": 1 10 | } 11 | ``` 12 | 13 | * `dir` / `Dir` (string): Directory name 14 | * `size` / `Size` (Nullable): Usage 15 | * `count` / `Count` (Nullable): File count 16 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Daniel Cowgill 2 | Dustin Zeisler 3 | Jesse Harris 4 | Kevin Bombino 5 | Kevin Killingsworth 6 | Martyn Garcia 7 | Rommel Santor 8 | Sam Harrison 9 | -------------------------------------------------------------------------------- /docs/FileAction.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FileAction 2 | 3 | ## Example FileAction Object 4 | 5 | ``` 6 | { 7 | "status": "pending", 8 | "file_migration_id": 1 9 | } 10 | ``` 11 | 12 | * `status` / `Status` (string): Status of file operation. 13 | * `file_migration_id` / `FileMigrationId` (Nullable): If status is pending, this is the id of the File Migration to check for status updates. 14 | -------------------------------------------------------------------------------- /docs/BundlePath.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BundlePath 2 | 3 | ## Example BundlePath Object 4 | 5 | ``` 6 | { 7 | "recursive": true, 8 | "path": "example" 9 | } 10 | ``` 11 | 12 | * `recursive` / `Recursive` (bool): Allow access to subfolders content? 13 | * `path` / `Path` (string): The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 14 | -------------------------------------------------------------------------------- /docs/ShareGroupMember.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.ShareGroupMember 2 | 3 | ## Example ShareGroupMember Object 4 | 5 | ``` 6 | { 7 | "name": "John Doe", 8 | "company": "Acme Ltd", 9 | "email": "johndoe@gmail.com" 10 | } 11 | ``` 12 | 13 | * `name` / `Name` (string): Name of the share group member 14 | * `company` / `Company` (string): Company of the share group member 15 | * `email` / `Email` (string): Email of the share group member 16 | -------------------------------------------------------------------------------- /examples/files-cli/log4net.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/files-cli/app.config.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/PublicIpAddress.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.PublicIpAddress 2 | 3 | ## Example PublicIpAddress Object 4 | 5 | ``` 6 | { 7 | "ip_address": "1.1.1.1", 8 | "server_name": "server-1", 9 | "ftp_enabled": true, 10 | "sftp_enabled": true 11 | } 12 | ``` 13 | 14 | * `ip_address` / `IpAddress` (string): The public IP address. 15 | * `server_name` / `ServerName` (string): The name of the frontend server. 16 | * `ftp_enabled` / `FtpEnabled` (bool): 17 | * `sftp_enabled` / `SftpEnabled` (bool): 18 | -------------------------------------------------------------------------------- /docs/PaymentLineItem.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.PaymentLineItem 2 | 3 | ## Example PaymentLineItem Object 4 | 5 | ``` 6 | { 7 | "amount": 1.0, 8 | "created_at": "2000-01-01T01:00:00Z", 9 | "invoice_id": 1, 10 | "payment_id": 1 11 | } 12 | ``` 13 | 14 | * `amount` / `Amount` (double): Payment line item amount 15 | * `created_at` / `CreatedAt` (Nullable): Payment line item created at date/time 16 | * `invoice_id` / `InvoiceId` (Nullable): Invoice ID 17 | * `payment_id` / `PaymentId` (Nullable): Payment ID 18 | -------------------------------------------------------------------------------- /docs/Preview.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Preview 2 | 3 | ## Example Preview Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "status": "complete", 9 | "download_uri": "https://mysite.files.com/...", 10 | "type": "image", 11 | "size": "large" 12 | } 13 | ``` 14 | 15 | * `id` / `Id` (Nullable): Preview ID 16 | * `status` / `Status` (string): Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 17 | * `download_uri` / `DownloadUri` (string): Link to download preview 18 | * `type` / `Type` (string): Preview type. Can be image, pdf, pdf_native, video, or audio 19 | * `size` / `Size` (string): Preview size 20 | -------------------------------------------------------------------------------- /examples/files-cli/files-cli.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | files_cli 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/AgentPushUpdate.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.AgentPushUpdate 2 | 3 | ## Example AgentPushUpdate Object 4 | 5 | ``` 6 | { 7 | "version": "example", 8 | "message": "example", 9 | "current_version": "example", 10 | "pending_version": "example", 11 | "last_error": "example", 12 | "error": "example" 13 | } 14 | ``` 15 | 16 | * `version` / `Version` (string): Pushed agent version 17 | * `message` / `Message` (string): Update accepted or reason 18 | * `current_version` / `CurrentVersion` (string): Installed agent version 19 | * `pending_version` / `PendingVersion` (string): Pending agent version or null 20 | * `last_error` / `LastError` (string): Last error message or null 21 | * `error` / `Error` (string): Error code 22 | -------------------------------------------------------------------------------- /shared/header_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "headers": {}, 4 | "result": null 5 | }, 6 | { 7 | "headers": { 8 | "Retry-After": ["aaaaaa"] 9 | }, 10 | "result": null 11 | }, 12 | { 13 | "headers": { 14 | "Retry-After": ["5"] 15 | }, 16 | "result": 5 17 | }, 18 | { 19 | "headers": { 20 | "Retry-After": ["60"] 21 | }, 22 | "result": null 23 | }, 24 | { 25 | "headers": { 26 | "Retry-After": ["5", "10"] 27 | }, 28 | "result": 5 29 | }, 30 | { 31 | "headers": { 32 | "Retry-After": ["5", "aaaaaa"] 33 | }, 34 | "result": 5 35 | }, 36 | { 37 | "headers": { 38 | "Retry-After": ["%s"] 39 | }, 40 | "result": 8 41 | } 42 | ] -------------------------------------------------------------------------------- /sdk/FilesCom/ResponseError.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace FilesCom 5 | { 6 | public class ResponseError 7 | { 8 | public string detail { get; set; } 9 | public string error { get; set; } 10 | public string[] errors { get; set; } 11 | [JsonPropertyName("http-code")] 12 | public int httpCode { get; set; } 13 | public string instance { get; set; } 14 | [JsonPropertyName("model_errors")] 15 | public Dictionary modelErrors { get; set; } 16 | public string title { get; set; } 17 | public string type { get; set; } 18 | public Dictionary data { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /docs/Status.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Status 2 | 3 | ## Example Status Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "example", 9 | "status": "", 10 | "data": "example", 11 | "errors": [ 12 | { 13 | "fields": [ 14 | 15 | ], 16 | "messages": [ 17 | 18 | ] 19 | } 20 | ], 21 | "clickwrap_id": 1, 22 | "clickwrap_body": "example" 23 | } 24 | ``` 25 | 26 | * `code` / `Code` (Nullable): Status HTTP code 27 | * `message` / `Message` (string): Error message 28 | * `status` / `StatusType` (string): Status message 29 | * `data` / `Data` (Auto): Additional data 30 | * `errors` / `Errors` (object[]): A list of api errors 31 | * `clickwrap_id` / `ClickwrapId` (Nullable): Required Clickwrap id 32 | * `clickwrap_body` / `ClickwrapBody` (string): Required Clickwrap body 33 | -------------------------------------------------------------------------------- /sdk/FilesTests/FilesTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .net6 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/FormField.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FormField 2 | 3 | ## Example FormField Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "label": "Sample Label", 9 | "required": true, 10 | "help_text": "Help Text", 11 | "field_type": "text", 12 | "options_for_select": [ 13 | "red", 14 | "green", 15 | "blue" 16 | ], 17 | "default_option": "red", 18 | "form_field_set_id": 1 19 | } 20 | ``` 21 | 22 | * `id` / `Id` (Nullable): Form field id 23 | * `label` / `Label` (string): Label to be displayed 24 | * `required` / `Required` (bool): Is this a required field? 25 | * `help_text` / `HelpText` (string): Help text to be displayed 26 | * `field_type` / `FieldType` (string): Type of Field 27 | * `options_for_select` / `OptionsForSelect` (string[]): Options to display for radio and dropdown 28 | * `default_option` / `DefaultOption` (string): Default option for radio and dropdown 29 | * `form_field_set_id` / `FormFieldSetId` (Nullable): Form field set id 30 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Thank you for your interest in Files.com security. We recognize that your data is very personal and sensitive and we work hard to keep it protected. 4 | 5 | 6 | ## Supported Versions 7 | 8 | Only the latest version will be supported with security updates. 9 | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | Here at Files.com, we celebrate security and we encourage independent security researchers to help us keep our products secure. 14 | 15 | We offer a Security Bug Bounty Program to create an incentive and reward structure so that researchers are able to devote resources to working on Files.com. 16 | 17 | We offer our Bug Bounty Program on HackerOne at https://hackerone.com/files 18 | 19 | We prefer to receive reports of vulnerabilities there. 20 | 21 | If you do not wish to use HackerOne, alternate submission instructions are available at: 22 | https://www.files.com/legal/security-bounty/ 23 | 24 | Thank you for helping keep the Files.com community secure! 25 | -------------------------------------------------------------------------------- /examples/files-cli/Files.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using FilesCom; 4 | using ManyConsole; 5 | 6 | namespace files_cli 7 | { 8 | class Files 9 | { 10 | private static log4net.ILog log; 11 | 12 | public static IEnumerable GetCommands() 13 | { 14 | return ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Files)); 15 | } 16 | 17 | public static int Main(string[] args) 18 | { 19 | log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 20 | log.Info("Starting up"); 21 | 22 | FilesClient filesClient = new FilesClient(); 23 | 24 | var commands = GetCommands(); 25 | int result = ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); 26 | 27 | log.Info("Complete"); 28 | return result; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/files-cli/Commands/ListUsersCommand.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Models; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace files_cli.Commands 6 | { 7 | public class ListUsersCommand : BaseCommand 8 | { 9 | public ListUsersCommand() 10 | { 11 | IsCommand("ListUsers", "Lists all users"); 12 | 13 | HasLongDescription("This command lists all users that can be seen by the given API Key"); 14 | } 15 | 16 | public override async Task RunAsync(string[] remainingArguments) 17 | { 18 | User[] users = await User.All(null, await GetOptions()); 19 | 20 | Console.WriteLine($"Found {users.Length} users"); 21 | Console.WriteLine(); 22 | Console.WriteLine($"User ID, Username, Name"); 23 | 24 | foreach(User user in users) 25 | { 26 | Console.WriteLine($"{user.Id}, {user.Username}, {user.Name}"); 27 | } 28 | return Success; 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /docs/HolidayRegion.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.HolidayRegion 2 | 3 | ## Example HolidayRegion Object 4 | 5 | ``` 6 | { 7 | "code": "us_dc", 8 | "name": "United States - District of Columbia" 9 | } 10 | ``` 11 | 12 | * `code` / `Code` (string): The code representing a region 13 | * `name` / `Name` (string): The name of the region 14 | 15 | 16 | --- 17 | 18 | ## List all possible holiday regions 19 | 20 | ``` 21 | Task> HolidayRegion.GetSupported( 22 | 23 | Dictionary parameters = null, 24 | Dictionary options = null 25 | ) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 31 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 32 | -------------------------------------------------------------------------------- /examples/files-cli/Commands/UploadFileCommand.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Models; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace files_cli.Commands 6 | { 7 | public class UploadFileCommand : BaseCommand 8 | { 9 | string Path { get; set; } 10 | string LocalPath { get; set; } 11 | 12 | public UploadFileCommand() 13 | { 14 | IsCommand("UploadFile", "Uploads a file"); 15 | 16 | HasLongDescription("Uploads a file to a given path."); 17 | 18 | HasRequiredOption("path=", "The path of the file to be uploaded.", path => Path = path); 19 | HasOption("localPath=", "The path of the file to be uploaded.", localPath => LocalPath = localPath); 20 | 21 | LocalPath = System.IO.Directory.GetCurrentDirectory(); 22 | } 23 | 24 | public override async Task RunAsync(string[] remainingArguments) 25 | { 26 | var result = await RemoteFile.UploadFile(LocalPath, Path, await GetOptions()); 27 | Console.WriteLine(result); 28 | 29 | return 0; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/files-cli/Commands/DownloadFileCommand.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Models; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace files_cli.Commands 6 | { 7 | public class DownloadFileCommand : BaseCommand 8 | { 9 | string Path { get; set; } 10 | string LocalPath { get; set; } 11 | 12 | public DownloadFileCommand() 13 | { 14 | IsCommand("DownloadFile", "Downloads a file"); 15 | 16 | HasLongDescription("Downloads a file by a given path."); 17 | 18 | HasRequiredOption("path=", "The path of the file to download.", path => Path = path); 19 | HasOption("localPath=", "The local path and file name to save the file.", localPath => LocalPath = localPath); 20 | 21 | LocalPath = System.IO.Directory.GetCurrentDirectory(); 22 | } 23 | 24 | public override async Task RunAsync(string[] remainingArguments) 25 | { 26 | var result = await RemoteFile.DownloadFile(Path, LocalPath, await GetOptions()); 27 | Console.WriteLine(result); 28 | 29 | return 0; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019- Action Verb, LLC (https://www.files.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/examples.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "files-cli", "files-cli\files-cli.csproj", "{C852FA95-75ED-40A7-AD18-99A9259E2ED9}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C852FA95-75ED-40A7-AD18-99A9259E2ED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {C852FA95-75ED-40A7-AD18-99A9259E2ED9}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {C852FA95-75ED-40A7-AD18-99A9259E2ED9}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {C852FA95-75ED-40A7-AD18-99A9259E2ED9}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(MonoDevelopProperties) = preSolution 18 | Policies = $0 19 | $0.TextStylePolicy = $1 20 | $1.FileWidth = 80 21 | $1.TabsToSpaces = True 22 | $1.NoTabsAfterNonTabs = True 23 | $1.scope = text/x-csharp 24 | $0.CSharpFormattingPolicy = $2 25 | $2.scope = text/x-csharp 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /docs/Priority.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Priority 2 | 3 | ## Example Priority Object 4 | 5 | ``` 6 | { 7 | "path": "foo/bar", 8 | "color": "pink" 9 | } 10 | ``` 11 | 12 | * `path` / `Path` (string): The path corresponding to the priority color. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 13 | * `color` / `Color` (string): The priority color 14 | 15 | 16 | --- 17 | 18 | ## List Priorities 19 | 20 | ``` 21 | Task> Priority.List( 22 | string path, 23 | Dictionary parameters = null, 24 | Dictionary options = null 25 | ) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 31 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 32 | * `path` (string): Required - The path to query for priorities 33 | -------------------------------------------------------------------------------- /docs/DnsRecord.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.DnsRecord 2 | 3 | ## Example DnsRecord Object 4 | 5 | ``` 6 | { 7 | "id": "customdomain.com-CNAME-site.files.com", 8 | "domain": "my-custom-domain.com", 9 | "rrtype": "CNAME", 10 | "value": "mysite.files.com" 11 | } 12 | ``` 13 | 14 | * `id` / `Id` (string): Unique label for DNS record; used by Zapier and other integrations. 15 | * `domain` / `Domain` (string): DNS record domain name 16 | * `rrtype` / `Rrtype` (string): DNS record type 17 | * `value` / `Value` (string): DNS record value 18 | 19 | 20 | --- 21 | 22 | ## Show Site DNS Configuration 23 | 24 | ``` 25 | Task> DnsRecord.List( 26 | 27 | Dictionary parameters = null, 28 | Dictionary options = null 29 | ) 30 | ``` 31 | 32 | ### Parameters 33 | 34 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 35 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 36 | -------------------------------------------------------------------------------- /sdk/FilesTests/Util/PathUtilTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System; 5 | using System.IO; 6 | using System.Text.Json; 7 | using FilesCom; 8 | using FilesCom.Util; 9 | 10 | namespace FilesTests.PathUtilTest 11 | { 12 | [TestClass] 13 | public class PathUtilTest 14 | { 15 | public static IEnumerable GetComparisons() 16 | { 17 | dynamic source; 18 | string filePath = System.IO.Path.GetFullPath("../../../../../shared/normalization_for_comparison_test_data.json"); 19 | using (StreamReader r = new StreamReader(filePath)) 20 | { 21 | string json = r.ReadToEnd(); 22 | source = JsonSerializer.Deserialize(json); 23 | } 24 | 25 | foreach (var item in source.EnumerateArray()) 26 | { 27 | yield return new string[] { item[0].GetString(), item[1].GetString() }; 28 | } 29 | } 30 | 31 | 32 | [TestMethod, DynamicData(nameof(GetComparisons), DynamicDataSourceType.Method)] 33 | public void TestSame(string a, string b) 34 | { 35 | Assert.IsTrue(PathUtil.same(a, b)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/FileMigration.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FileMigration 2 | 3 | ## Example FileMigration Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "MyFolder", 9 | "dest_path": "MyFolder", 10 | "files_moved": 1, 11 | "files_total": 1, 12 | "operation": "move", 13 | "region": "USA", 14 | "status": "complete", 15 | "log_url": "https://www.example.com/log_file" 16 | } 17 | ``` 18 | 19 | * `id` / `Id` (Nullable): File migration ID 20 | * `path` / `Path` (string): Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 21 | * `dest_path` / `DestPath` (string): Destination path 22 | * `files_moved` / `FilesMoved` (Nullable): Number of files processed 23 | * `files_total` / `FilesTotal` (Nullable): 24 | * `operation` / `Operation` (string): The type of operation 25 | * `region` / `Region` (string): Region 26 | * `status` / `Status` (string): Status 27 | * `log_url` / `LogUrl` (string): Link to download the log file for this migration. 28 | 29 | 30 | --- 31 | 32 | ## Show File Migration 33 | 34 | ``` 35 | Task FileMigration.Find( 36 | Nullable id, 37 | Dictionary parameters = null, 38 | Dictionary options = null 39 | ) 40 | ``` 41 | 42 | ### Parameters 43 | 44 | * `id` (Nullable): Required - File Migration ID. 45 | -------------------------------------------------------------------------------- /sdk/Files.com.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Files.com", "FilesCom\FilesCom.csproj", "{C8D938CB-35AA-42AE-A858-E3CAE9E35E1F}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FilesTests", "FilesTests\FilesTests.csproj", "{AB2C798D-7A63-4F32-8AD7-E0DAA7C4E8AC}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C8D938CB-35AA-42AE-A858-E3CAE9E35E1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C8D938CB-35AA-42AE-A858-E3CAE9E35E1F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C8D938CB-35AA-42AE-A858-E3CAE9E35E1F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C8D938CB-35AA-42AE-A858-E3CAE9E35E1F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {AB2C798D-7A63-4F32-8AD7-E0DAA7C4E8AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {AB2C798D-7A63-4F32-8AD7-E0DAA7C4E8AC}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {AB2C798D-7A63-4F32-8AD7-E0DAA7C4E8AC}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {AB2C798D-7A63-4F32-8AD7-E0DAA7C4E8AC}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /shared/url_test_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "substitute_urls": [ 3 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=%s&X-Goog-Expires=%s&X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-SignedHeaders=host", 4 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=%s&X-Amz-Expires=%s", 5 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=%s" 6 | ], 7 | "error_urls": [ 8 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z", 9 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&X-Goog-Date=20220202T120000Z", 10 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Expires=900&X-Goog-Expires=600", 11 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=20220101T120000Z&sp=se=20220202T120000Z", 12 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=20220101T120000Z", 13 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101&X-Goog-Expires=900", 14 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=asdf&X-Goog-Expires=900", 15 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&&X-Goog-Expires=900", 16 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=asdf&X-Amz-Expires=900" 17 | ] 18 | } -------------------------------------------------------------------------------- /docs/UserSftpClientUse.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UserSftpClientUse 2 | 3 | ## Example UserSftpClientUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sftp_client": "example", 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "updated_at": "2000-01-01T01:00:00Z", 11 | "user_id": 1 12 | } 13 | ``` 14 | 15 | * `id` / `Id` (Nullable): UserSftpClientUse ID 16 | * `sftp_client` / `SftpClient` (string): The SFTP client used 17 | * `created_at` / `CreatedAt` (Nullable): The earliest recorded use of this SFTP client (for this user) 18 | * `updated_at` / `UpdatedAt` (Nullable): The most recent use of this SFTP client (for this user) 19 | * `user_id` / `UserId` (Nullable): ID of the user who performed this access 20 | 21 | 22 | --- 23 | 24 | ## List User SFTP Client Uses 25 | 26 | ``` 27 | Task> UserSftpClientUse.List( 28 | 29 | Dictionary parameters = null, 30 | Dictionary options = null 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `user_id` (Nullable): User ID. If provided, will return uses for this user. 37 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 38 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 39 | -------------------------------------------------------------------------------- /docs/Action.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Action 2 | 3 | ## Example Action Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "", 9 | "when": "2000-01-01T01:00:00Z", 10 | "destination": "/to_path", 11 | "display": "Actual text of the action here.", 12 | "ip": "192.283.128.182", 13 | "source": "/from_path", 14 | "targets": null, 15 | "user_id": 1, 16 | "username": "user", 17 | "user_is_from_parent_site": true, 18 | "action": "create", 19 | "failure_type": "none", 20 | "interface": "web" 21 | } 22 | ``` 23 | 24 | * `id` / `Id` (Nullable): Action ID 25 | * `path` / `Path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 26 | * `when` / `When` (Nullable): Action occurrence date/time 27 | * `destination` / `Destination` (string): The destination path for this action, if applicable 28 | * `display` / `Display` (string): Friendly displayed output 29 | * `ip` / `Ip` (string): IP Address that performed this action 30 | * `source` / `Source` (string): The source path for this action, if applicable 31 | * `targets` / `Targets` (object): Targets 32 | * `user_id` / `UserId` (Nullable): User ID 33 | * `username` / `Username` (string): Username 34 | * `user_is_from_parent_site` / `UserIsFromParentSite` (bool): true if this change was performed by a user on a parent site. 35 | * `action` / `ActionType` (string): Type of action 36 | * `failure_type` / `FailureType` (string): Failure type. If action was a user login or session failure, why did it fail? 37 | * `interface` / `Interface` (string): Interface on which this action occurred. 38 | -------------------------------------------------------------------------------- /docs/InvoiceLineItem.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.InvoiceLineItem 2 | 3 | ## Example InvoiceLineItem Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "description": "Service from 2019-01-01 through 2019-12-31", 11 | "type": "invoice", 12 | "service_end_at": "2000-01-01T01:00:00Z", 13 | "service_start_at": "2000-01-01T01:00:00Z", 14 | "plan": "Premier", 15 | "site": "My site", 16 | "prepaid_bytes": 1, 17 | "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z", 18 | "prepaid_bytes_used": 1, 19 | "prepaid_bytes_available": 1 20 | } 21 | ``` 22 | 23 | * `id` / `Id` (Nullable): Invoice Line item Id 24 | * `amount` / `Amount` (double): Invoice line item amount 25 | * `created_at` / `CreatedAt` (Nullable): Invoice line item created at date/time 26 | * `description` / `Description` (string): Invoice line item description 27 | * `type` / `Type` (string): Invoice line item type 28 | * `service_end_at` / `ServiceEndAt` (Nullable): Invoice line item service end date/time 29 | * `service_start_at` / `ServiceStartAt` (Nullable): Invoice line item service start date/time 30 | * `plan` / `Plan` (string): Plan name 31 | * `site` / `Site` (string): Site name 32 | * `prepaid_bytes` / `PrepaidBytes` (Nullable): Prepaid bytes purchased for this invoice line item 33 | * `prepaid_bytes_expire_at` / `PrepaidBytesExpireAt` (Nullable): When the prepaid bytes expire 34 | * `prepaid_bytes_used` / `PrepaidBytesUsed` (Nullable): Total prepaid bytes used for this invoice line item 35 | * `prepaid_bytes_available` / `PrepaidBytesAvailable` (Nullable): Available prepaid bytes for this invoice line item 36 | -------------------------------------------------------------------------------- /docs/Session.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Session 2 | 3 | ## Example Session Object 4 | 5 | ``` 6 | { 7 | "id": "60525f92e859c4c3d74cb02fd176b1525901b525", 8 | "language": "en", 9 | "read_only": true, 10 | "sftp_insecure_ciphers": true 11 | } 12 | ``` 13 | 14 | * `id` / `Id` (string): Session ID 15 | * `language` / `Language` (string): Session language 16 | * `read_only` / `ReadOnly` (bool): Is this session read only? 17 | * `sftp_insecure_ciphers` / `SftpInsecureCiphers` (bool): Are insecure SFTP ciphers allowed for this user? (If this is set to true, the site administrator has signaled that it is ok to use less secure SSH ciphers for this user.) 18 | * `username` / `Username` (string): Username to sign in as 19 | * `password` / `Password` (string): Password for sign in 20 | * `otp` / `Otp` (string): If this user has a 2FA device, provide its OTP or code here. 21 | * `partial_session_id` / `PartialSessionId` (string): Identifier for a partially-completed login 22 | 23 | 24 | --- 25 | 26 | ## Create user session (log in) 27 | 28 | ``` 29 | Task Session.Create( 30 | 31 | Dictionary parameters = null, 32 | Dictionary options = null 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `username` (string): Username to sign in as 39 | * `password` (string): Password for sign in 40 | * `otp` (string): If this user has a 2FA device, provide its OTP or code here. 41 | * `partial_session_id` (string): Identifier for a partially-completed login 42 | 43 | 44 | --- 45 | 46 | ## Delete user session (log out) 47 | 48 | ``` 49 | Task Session.Delete( 50 | 51 | Dictionary parameters = null, 52 | Dictionary options = null 53 | ) 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/FileCommentReaction.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FileCommentReaction 2 | 3 | ## Example FileCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` / `Id` (Nullable): Reaction ID 13 | * `emoji` / `Emoji` (string): Emoji used in the reaction. 14 | * `user_id` / `UserId` (Nullable): User ID. Provide a value of `0` to operate the current session's user. 15 | * `file_comment_id` / `FileCommentId` (Nullable): ID of file comment to attach reaction to. 16 | 17 | 18 | --- 19 | 20 | ## Create File Comment Reaction 21 | 22 | ``` 23 | Task FileCommentReaction.Create( 24 | 25 | Dictionary parameters = null, 26 | Dictionary options = null 27 | ) 28 | ``` 29 | 30 | ### Parameters 31 | 32 | * `user_id` (Nullable): User ID. Provide a value of `0` to operate the current session's user. 33 | * `file_comment_id` (Nullable): Required - ID of file comment to attach reaction to. 34 | * `emoji` (string): Required - Emoji to react with. 35 | 36 | 37 | --- 38 | 39 | ## Delete File Comment Reaction 40 | 41 | ``` 42 | Task FileCommentReaction.Delete( 43 | Nullable id, 44 | Dictionary parameters = null, 45 | Dictionary options = null 46 | ) 47 | ``` 48 | 49 | ### Parameters 50 | 51 | * `id` (Nullable): Required - File Comment Reaction ID. 52 | 53 | 54 | --- 55 | 56 | ## Delete File Comment Reaction 57 | 58 | ``` 59 | var FileCommentReaction = FileCommentReaction.ListFor(path)[0]; 60 | 61 | var parameters = new Dictionary(); 62 | 63 | 64 | FileCommentReaction.Delete 65 | ``` 66 | 67 | ### Parameters 68 | 69 | * `id` (Nullable): Required - File Comment Reaction ID. 70 | -------------------------------------------------------------------------------- /sdk/FilesCom/FilesCom.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0;net6.0;net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;netstandard2.1;netstandard2.0 4 | false 5 | FilesCom 6 | 1.4.343 7 | Files.com - support@files.com - https://www.files.com/ 8 | Files.com Client 9 | The Files.com .NET Client library provides convenient access to the Files.com API from applications using the .NET framework. 10 | Copyright 2020-2025 11 | https://github.com/Files-com/files-sdk-dotnet/tree/master/sdk/FilesCom 12 | icon.png 13 | false 14 | MIT 15 | 16 | Files.com releases contain API improvements, bugfixes, and more. 17 | 18 | Files Files.com FTP SFTP SCP WebDAV 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /sdk/FilesCom/FilesListEnumerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | namespace FilesCom 7 | { 8 | public class FilesListEnumerator : IEnumerator, IEnumerable 9 | { 10 | private FilesList filesList; 11 | private int index = -1; 12 | private T current; 13 | 14 | public FilesListEnumerator(FilesList filesList) 15 | { 16 | this.filesList = filesList; 17 | Task.Run(() => filesList.LoadNextPage()).Wait(); 18 | } 19 | 20 | public T Current { get { return current; } } 21 | 22 | object IEnumerator.Current { get { return current; } } 23 | 24 | public void Dispose() 25 | { 26 | // no resources to release 27 | } 28 | 29 | public IEnumerator GetEnumerator() 30 | { 31 | return this; 32 | } 33 | 34 | IEnumerator IEnumerable.GetEnumerator() 35 | { 36 | return this; 37 | } 38 | 39 | public void Reset() 40 | { 41 | filesList.Reset(); 42 | Task.Run(() => filesList.LoadNextPage()).Wait(); 43 | index = -1; 44 | } 45 | 46 | public bool MoveNext() 47 | { 48 | index++; 49 | if (index >= filesList.data.Count) 50 | { 51 | if (filesList.HasNextPage) 52 | { 53 | Task.Run(() => filesList.LoadNextPage()).Wait(); 54 | index = 0; 55 | } 56 | else 57 | { 58 | return false; 59 | } 60 | } 61 | 62 | if (filesList.data.Count == 0) 63 | { 64 | return false; 65 | } 66 | 67 | current = filesList.data[index]; 68 | return true; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /sdk/FilesCom/Models/Auto.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class Auto 12 | { 13 | private Dictionary attributes; 14 | private Dictionary options; 15 | public Auto() : this(null, null) { } 16 | 17 | public Auto(Dictionary attributes, Dictionary options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("dynamic")) 33 | { 34 | this.attributes.Add("dynamic", null); 35 | } 36 | } 37 | 38 | public Dictionary getAttributes() 39 | { 40 | return new Dictionary(this.attributes); 41 | } 42 | 43 | public object GetOption(string name) 44 | { 45 | return (this.options.ContainsKey(name) ? this.options[name] : null); 46 | } 47 | 48 | public void SetOption(string name, object value) 49 | { 50 | this.options[name] = value; 51 | } 52 | 53 | 54 | /// 55 | /// 56 | [JsonInclude] 57 | [JsonPropertyName("dynamic")] 58 | public object Dynamic 59 | { 60 | get { return (object)attributes["dynamic"]; } 61 | private set { attributes["dynamic"] = value; } 62 | } 63 | 64 | 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /sdk/FilesCom/Util/BooleanJsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.Json; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace FilesCom.Util 6 | { 7 | public class BooleanJsonConverter : JsonConverter 8 | { 9 | private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(BooleanJsonConverter)); 10 | public override bool Read(ref Utf8JsonReader reader, 11 | Type typeToConvert, 12 | JsonSerializerOptions options) 13 | { 14 | 15 | if (reader.TokenType == JsonTokenType.String) 16 | { 17 | return Convert.ToBoolean(reader.GetString() ?? String.Empty); 18 | } 19 | else if (reader.TokenType == JsonTokenType.Number) 20 | { 21 | var stringValue = reader.GetDouble(); 22 | return Convert.ToBoolean(stringValue.ToString()); 23 | } 24 | else if (reader.TokenType == JsonTokenType.False || 25 | reader.TokenType == JsonTokenType.True) 26 | { 27 | return reader.GetBoolean(); 28 | } 29 | else if (reader.TokenType == JsonTokenType.Null) 30 | { 31 | return false; 32 | } 33 | else if (reader.TokenType == JsonTokenType.StartArray) 34 | { 35 | reader.Skip(); 36 | return false; 37 | } 38 | else if (reader.TokenType == JsonTokenType.StartObject) 39 | { 40 | reader.Skip(); 41 | return false; 42 | } 43 | else 44 | { 45 | log.Error($"Unsupported token type: {reader.TokenType}"); 46 | throw new System.Text.Json.JsonException(); 47 | } 48 | } 49 | 50 | public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options) 51 | { 52 | writer.WriteBooleanValue(value); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /docs/SettingsChange.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.SettingsChange 2 | 3 | ## Example SettingsChange Object 4 | 5 | ``` 6 | { 7 | "api_key_id": 1, 8 | "changes": [ 9 | "example" 10 | ], 11 | "created_at": "2000-01-01T01:00:00Z", 12 | "user_id": 1, 13 | "user_is_files_support": true, 14 | "user_is_from_parent_site": true, 15 | "username": "some_user" 16 | } 17 | ``` 18 | 19 | * `api_key_id` / `ApiKeyId` (Nullable): The API key id responsible for this change. 20 | * `changes` / `Changes` (string[]): Markdown-formatted change messages. 21 | * `created_at` / `CreatedAt` (Nullable): The time this change was made. 22 | * `user_id` / `UserId` (Nullable): The user id responsible for this change. 23 | * `user_is_files_support` / `UserIsFilesSupport` (bool): true if this change was performed by Files.com support. 24 | * `user_is_from_parent_site` / `UserIsFromParentSite` (bool): true if this change was performed by a user on a parent site. 25 | * `username` / `Username` (string): The username of the user responsible for this change. 26 | 27 | 28 | --- 29 | 30 | ## List Settings Changes 31 | 32 | ``` 33 | Task> SettingsChange.List( 34 | 35 | Dictionary parameters = null, 36 | Dictionary options = null 37 | ) 38 | ``` 39 | 40 | ### Parameters 41 | 42 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 43 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 44 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `api_key_id` or `user_id`. 45 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`. 46 | -------------------------------------------------------------------------------- /docs/WebhookTest.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.WebhookTest 2 | 3 | ## Example WebhookTest Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "", 9 | "status": "", 10 | "data": "example", 11 | "success": true 12 | } 13 | ``` 14 | 15 | * `code` / `Code` (Nullable): Status HTTP code 16 | * `message` / `Message` (string): Error message 17 | * `status` / `Status` (string): Status message 18 | * `data` / `Data` (Auto): Additional data 19 | * `success` / `Success` (bool): The success status of the webhook test 20 | * `url` / `Url` (string): URL for testing the webhook. 21 | * `method` / `Method` (string): HTTP method(GET or POST). 22 | * `encoding` / `Encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 23 | * `headers` / `Headers` (object): Additional request headers. 24 | * `body` / `Body` (object): Additional body parameters. 25 | * `raw_body` / `RawBody` (string): raw body text 26 | * `file_as_body` / `FileAsBody` (bool): Send the file data as the request body? 27 | * `file_form_field` / `FileFormField` (string): Send the file data as a named parameter in the request POST body 28 | * `action` / `Action` (string): action for test body 29 | * `use_dedicated_ips` / `UseDedicatedIps` (bool): Use dedicated IPs for sending the webhook? 30 | 31 | 32 | --- 33 | 34 | ## Create Webhook Test 35 | 36 | ``` 37 | Task WebhookTest.Create( 38 | 39 | Dictionary parameters = null, 40 | Dictionary options = null 41 | ) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `url` (string): Required - URL for testing the webhook. 47 | * `method` (string): HTTP method(GET or POST). 48 | * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 49 | * `headers` (object): Additional request headers. 50 | * `body` (object): Additional body parameters. 51 | * `raw_body` (string): raw body text 52 | * `file_as_body` (bool): Send the file data as the request body? 53 | * `file_form_field` (string): Send the file data as a named parameter in the request POST body 54 | * `action` (string): action for test body 55 | * `use_dedicated_ips` (bool): Use dedicated IPs for sending the webhook? 56 | -------------------------------------------------------------------------------- /docs/AccountLineItem.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.AccountLineItem 2 | 3 | ## Example AccountLineItem Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "id": 1, 16 | "amount": 1.0, 17 | "created_at": "2000-01-01T01:00:00Z", 18 | "description": "Service from 2019-01-01 through 2019-12-31", 19 | "type": "invoice", 20 | "service_end_at": "2000-01-01T01:00:00Z", 21 | "service_start_at": "2000-01-01T01:00:00Z", 22 | "plan": "Premier", 23 | "site": "My site", 24 | "prepaid_bytes": 1, 25 | "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z", 26 | "prepaid_bytes_used": 1, 27 | "prepaid_bytes_available": 1 28 | } 29 | ], 30 | "method": "paypal", 31 | "payment_line_items": [ 32 | { 33 | "amount": 1.0, 34 | "created_at": "2000-01-01T01:00:00Z", 35 | "invoice_id": 1, 36 | "payment_id": 1 37 | } 38 | ], 39 | "payment_reversed_at": "2000-01-01T01:00:00Z", 40 | "payment_type": "example", 41 | "site_name": "My Site", 42 | "type": "invoice" 43 | } 44 | ``` 45 | 46 | * `id` / `Id` (Nullable): Line item Id 47 | * `amount` / `Amount` (double): Line item amount 48 | * `balance` / `Balance` (double): Line item balance 49 | * `created_at` / `CreatedAt` (Nullable): Line item created at 50 | * `currency` / `Currency` (string): Line item currency 51 | * `download_uri` / `DownloadUri` (string): Line item download uri 52 | * `invoice_line_items` / `InvoiceLineItems` (object[]): Associated invoice line items 53 | * `method` / `Method` (string): Line item payment method 54 | * `payment_line_items` / `PaymentLineItems` (object[]): Associated payment line items 55 | * `payment_reversed_at` / `PaymentReversedAt` (Nullable): Date/time payment was reversed if applicable 56 | * `payment_type` / `PaymentType` (string): Type of payment if applicable 57 | * `site_name` / `SiteName` (string): Site name this line item is for 58 | * `type` / `Type` (string): Type of line item, either payment or invoice 59 | -------------------------------------------------------------------------------- /docs/FileUploadPart.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FileUploadPart 2 | 3 | ## Example FileUploadPart Object 4 | 5 | ``` 6 | { 7 | "send": { 8 | "key": "example value" 9 | }, 10 | "action": "multipart", 11 | "ask_about_overwrites": true, 12 | "available_parts": 1, 13 | "expires": "example", 14 | "headers": { 15 | "key": "example value" 16 | }, 17 | "http_method": "PUT", 18 | "next_partsize": 1, 19 | "parallel_parts": true, 20 | "retry_parts": true, 21 | "parameters": { 22 | "key": "example value" 23 | }, 24 | "part_number": 1, 25 | "partsize": 1, 26 | "path": "", 27 | "ref": "upload-1", 28 | "upload_uri": "example" 29 | } 30 | ``` 31 | 32 | * `send` / `Send` (object): Content-Type and File to send 33 | * `action` / `Action` (string): Type of upload 34 | * `ask_about_overwrites` / `AskAboutOverwrites` (bool): If `true`, this file exists and you may wish to ask the user for overwrite confirmation 35 | * `available_parts` / `AvailableParts` (Nullable): Number of parts in the upload 36 | * `expires` / `Expires` (string): Date/time of when this Upload part expires and the URL cannot be used any more 37 | * `headers` / `Headers` (object): Additional upload headers to provide as part of the upload 38 | * `http_method` / `HttpMethod` (string): HTTP Method to use for uploading the part, usually `PUT` 39 | * `next_partsize` / `NextPartsize` (Nullable): Size in bytes for this part 40 | * `parallel_parts` / `ParallelParts` (bool): If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order. 41 | * `retry_parts` / `RetryParts` (bool): If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted. 42 | * `parameters` / `Parameters` (object): Additional HTTP parameters to send with the upload 43 | * `part_number` / `PartNumber` (Nullable): Number of this upload part 44 | * `partsize` / `Partsize` (Nullable): Size in bytes for the next upload part 45 | * `path` / `Path` (string): New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 46 | * `ref` / `Ref` (string): Reference name for this upload part 47 | * `upload_uri` / `UploadUri` (string): URI to upload this part to 48 | -------------------------------------------------------------------------------- /docs/ScimLog.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.ScimLog 2 | 3 | ## Example ScimLog Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "created_at": "2023-01-01T12:00:00Z", 9 | "request_path": "/api/scim/Users", 10 | "request_method": "POST", 11 | "http_response_code": "200", 12 | "user_agent": "Okta", 13 | "request_json": "example", 14 | "response_json": "example" 15 | } 16 | ``` 17 | 18 | * `id` / `Id` (Nullable): The unique ID of this SCIM request. 19 | * `created_at` / `CreatedAt` (string): The date and time when this SCIM request occurred. 20 | * `request_path` / `RequestPath` (string): The path portion of the URL requested. 21 | * `request_method` / `RequestMethod` (string): The HTTP method used for this request. 22 | * `http_response_code` / `HttpResponseCode` (string): The HTTP response code returned for this request. 23 | * `user_agent` / `UserAgent` (string): The User-Agent header sent with the request. 24 | * `request_json` / `RequestJson` (string): The JSON payload sent with the request. 25 | * `response_json` / `ResponseJson` (string): The JSON payload returned in the response. 26 | 27 | 28 | --- 29 | 30 | ## List Scim Logs 31 | 32 | ``` 33 | Task> ScimLog.List( 34 | 35 | Dictionary parameters = null, 36 | Dictionary options = null 37 | ) 38 | ``` 39 | 40 | ### Parameters 41 | 42 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 43 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 44 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 45 | 46 | 47 | --- 48 | 49 | ## Show Scim Log 50 | 51 | ``` 52 | Task ScimLog.Find( 53 | Nullable id, 54 | Dictionary parameters = null, 55 | Dictionary options = null 56 | ) 57 | ``` 58 | 59 | ### Parameters 60 | 61 | * `id` (Nullable): Required - Scim Log ID. 62 | -------------------------------------------------------------------------------- /docs/InboxRegistration.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.InboxRegistration 2 | 3 | ## Example InboxRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "clickwrap_body": "example", 13 | "form_field_set_id": 1, 14 | "form_field_data": { 15 | "key": "example value" 16 | }, 17 | "inbox_id": 1, 18 | "inbox_recipient_id": 1, 19 | "inbox_title": "example", 20 | "created_at": "2000-01-01T01:00:00Z" 21 | } 22 | ``` 23 | 24 | * `code` / `Code` (string): Registration cookie code 25 | * `name` / `Name` (string): Registrant name 26 | * `company` / `Company` (string): Registrant company name 27 | * `email` / `Email` (string): Registrant email address 28 | * `ip` / `Ip` (string): Registrant IP Address 29 | * `clickwrap_body` / `ClickwrapBody` (string): Clickwrap text that was shown to the registrant 30 | * `form_field_set_id` / `FormFieldSetId` (Nullable): Id of associated form field set 31 | * `form_field_data` / `FormFieldData` (object): Data for form field set with form field ids as keys and user data as values 32 | * `inbox_id` / `InboxId` (Nullable): Id of associated inbox 33 | * `inbox_recipient_id` / `InboxRecipientId` (Nullable): Id of associated inbox recipient 34 | * `inbox_title` / `InboxTitle` (string): Title of associated inbox 35 | * `created_at` / `CreatedAt` (Nullable): Registration creation date/time 36 | 37 | 38 | --- 39 | 40 | ## List Inbox Registrations 41 | 42 | ``` 43 | Task> InboxRegistration.List( 44 | 45 | Dictionary parameters = null, 46 | Dictionary options = null 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 53 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 54 | * `folder_behavior_id` (Nullable): ID of the associated Inbox. This is required if the user is not a site admin. 55 | -------------------------------------------------------------------------------- /docs/RemoteBandwidthSnapshot.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.RemoteBandwidthSnapshot 2 | 3 | ## Example RemoteBandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sync_bytes_received": 1.0, 9 | "sync_bytes_sent": 1.0, 10 | "logged_at": "2000-01-01T01:00:00Z", 11 | "remote_server_id": 1 12 | } 13 | ``` 14 | 15 | * `id` / `Id` (Nullable): Site bandwidth ID 16 | * `sync_bytes_received` / `SyncBytesReceived` (double): Site sync bandwidth report bytes received 17 | * `sync_bytes_sent` / `SyncBytesSent` (double): Site sync bandwidth report bytes sent 18 | * `logged_at` / `LoggedAt` (Nullable): Time the site bandwidth report was logged 19 | * `remote_server_id` / `RemoteServerId` (Nullable): ID of related Remote Server 20 | 21 | 22 | --- 23 | 24 | ## List Remote Bandwidth Snapshots 25 | 26 | ``` 27 | Task> RemoteBandwidthSnapshot.List( 28 | 29 | Dictionary parameters = null, 30 | Dictionary options = null 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 37 | * `per_page` (Nullable): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 38 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 39 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 40 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 41 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 42 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 43 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 44 | -------------------------------------------------------------------------------- /shared/normalization_for_comparison_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ "filename.txt", "filename.txt" ], 3 | [ "FiLeNaMe.TxT", "filename.txt" ], 4 | [ "FILENAME.TXT", "filename.txt" ], 5 | [ "FÎŁĘÑÂMÉ.TXT", "filename.txt" ], 6 | [ "Fïłèńämê.Txt", "filename.txt" ], 7 | [ "a/b/c.txt", "a/b/c.txt" ], 8 | [ "A\\B\\C.TXT", "a/b/c.txt" ], 9 | [ "A/B\\C.TXT", "a/b/c.txt" ], 10 | [ "//a/b//c.txt", "a/b/c.txt" ], 11 | [ "a/b/c.txt ", "a/b/c.txt" ], 12 | [ "a/b/c.txt\t", "a/b/c.txt" ], 13 | [ "a/b/c.txt\n", "a/b/c.txt" ], 14 | [ "a/b/c.txt\r", "a/b/c.txt" ], 15 | [ " space_at_beginning", " space_at_beginning"], 16 | [ "space_at_end ", "space_at_end"], 17 | [ "tab\tseparated", "tab\tseparated"], 18 | [ "hello</hello>", "<title>hello</hello>"], 19 | [ "안녕하세요", "안녕하세요" ], 20 | [ "こんにちは", "こんにちは" ], 21 | [ "今日は", "今日は" ], 22 | [ "longest_unicode_character_﷽", "longest_unicode_character_﷽"], 23 | [ "invalid_null_byte_before\u0000after", "invalid_null_byte_beforeafter" ], 24 | [ "a/b/c/../../hello", "a/b/c/hello" ], 25 | [ "a/b/c/././hello", "a/b/c/hello" ], 26 | [ "one_code_point_ą", "one_code_point_a" ], 27 | [ "two_code_points_ą", "two_code_points_a" ], 28 | [ "one_code_point_훯", "one_code_point_훯"], 29 | [ "three_code_points_훯", "three_code_points_훯" ], 30 | [ "ÞþŊŋŦŧ", "þþŋŋŧŧ" ], 31 | [ "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "aaaaaaaeceeeeiiiidnoooooouuuuyssaaaaaaaeceeeeiiiidnoooooouuuuyy" ], 32 | [ "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİIJij", "aaaaaaccccccccddddeeeeeeeeeegggggggghhhhiiiiiiiiiijij" ], 33 | [ "ĴĵĶķĹĺĻļĽľŁłŃńŅņŇňʼnŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤť", "jjkkllllllllnnnnnnʼnoooooooeoerrrrrrsssssssstttt" ], 34 | [ "ŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž", "uuuuuuuuuuuuwwyyyzzzzzz" ], 35 | [ "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗", "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗" ], 36 | [ "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️", "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️" ], 37 | [ "emoji_‼️", "emoji_!!️" ], 38 | [ "<title>hello<:hello>.txt", "<title>hello<:hello>.txt" ], 39 | [ "twodotfile..txt", "twodotfile..txt" ], 40 | [ "three/.../dots_path", "three/.../dots_path" ], 41 | [ ".", "" ], 42 | [ "..", ""], 43 | [ "./..", "" ], 44 | [ "../..", ""], 45 | [ "./.", "" ], 46 | [ "../.", ""], 47 | [ "./../.", "" ], 48 | [ ".././..", ""] 49 | ] -------------------------------------------------------------------------------- /docs/Style.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Style 2 | 3 | ## Example Style Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "example", 9 | "logo": "https://mysite.files.com/...", 10 | "thumbnail": { 11 | "name": "My logo", 12 | "uri": "https://mysite.files.com/.../my_image.png" 13 | } 14 | } 15 | ``` 16 | 17 | * `id` / `Id` (Nullable<Int64>): Style ID 18 | * `path` / `Path` (string): Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 19 | * `logo` / `Logo` (Image): Logo 20 | * `thumbnail` / `Thumbnail` (Image): Logo thumbnail 21 | * `file` / `File` (System.Net.Http.ByteArrayContent): Logo for custom branding. 22 | 23 | 24 | --- 25 | 26 | ## Show Style 27 | 28 | ``` 29 | Task<Style> Style.Find( 30 | string path, 31 | Dictionary<string, object> parameters = null, 32 | Dictionary<string, object> options = null 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `path` (string): Required - Style path. 39 | 40 | 41 | --- 42 | 43 | ## Update Style 44 | 45 | ``` 46 | Task<Style> Style.Update( 47 | string path, 48 | Dictionary<string, object> parameters = null, 49 | Dictionary<string, object> options = null 50 | ) 51 | ``` 52 | 53 | ### Parameters 54 | 55 | * `path` (string): Required - Style path. 56 | * `file` (System.Net.Http.ByteArrayContent): Required - Logo for custom branding. 57 | 58 | 59 | --- 60 | 61 | ## Delete Style 62 | 63 | ``` 64 | Task Style.Delete( 65 | string path, 66 | Dictionary<string, object> parameters = null, 67 | Dictionary<string, object> options = null 68 | ) 69 | ``` 70 | 71 | ### Parameters 72 | 73 | * `path` (string): Required - Style path. 74 | 75 | 76 | --- 77 | 78 | ## Update Style 79 | 80 | ``` 81 | var Style = Style.Find(1); 82 | 83 | var parameters = new Dictionary<string, object>(); 84 | 85 | parameters.Add("file", "file"); 86 | 87 | Style.Update(parameters); 88 | ``` 89 | 90 | ### Parameters 91 | 92 | * `path` (string): Required - Style path. 93 | * `file` (System.Net.Http.ByteArrayContent): Required - Logo for custom branding. 94 | 95 | 96 | --- 97 | 98 | ## Delete Style 99 | 100 | ``` 101 | var Style = Style.Find(1); 102 | 103 | var parameters = new Dictionary<string, object>(); 104 | 105 | 106 | Style.Delete 107 | ``` 108 | 109 | ### Parameters 110 | 111 | * `path` (string): Required - Style path. 112 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/Image.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class Image 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public Image() : this(null, null) { } 16 | 17 | public Image(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("name")) 33 | { 34 | this.attributes.Add("name", null); 35 | } 36 | if (!this.attributes.ContainsKey("uri")) 37 | { 38 | this.attributes.Add("uri", null); 39 | } 40 | } 41 | 42 | public Dictionary<string, object> getAttributes() 43 | { 44 | return new Dictionary<string, object>(this.attributes); 45 | } 46 | 47 | public object GetOption(string name) 48 | { 49 | return (this.options.ContainsKey(name) ? this.options[name] : null); 50 | } 51 | 52 | public void SetOption(string name, object value) 53 | { 54 | this.options[name] = value; 55 | } 56 | 57 | 58 | /// <summary> 59 | /// Image name 60 | /// </summary> 61 | [JsonInclude] 62 | [JsonPropertyName("name")] 63 | public string Name 64 | { 65 | get { return (string)attributes["name"]; } 66 | private set { attributes["name"] = value; } 67 | } 68 | 69 | /// <summary> 70 | /// Image URI 71 | /// </summary> 72 | [JsonInclude] 73 | [JsonPropertyName("uri")] 74 | public string Uri 75 | { 76 | get { return (string)attributes["uri"]; } 77 | private set { attributes["uri"] = value; } 78 | } 79 | 80 | 81 | 82 | } 83 | } -------------------------------------------------------------------------------- /sdk/FilesCom/FilesConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | namespace FilesCom 4 | { 5 | public class FilesConfiguration : ConfigurationSection 6 | { 7 | [ConfigurationProperty("ApiKey")] 8 | public string ApiKey 9 | { 10 | get { return (string)this["ApiKey"]; } 11 | set { this["ApiKey"] = value; } 12 | } 13 | 14 | [ConfigurationProperty("SessionId")] 15 | public string SessionId 16 | { 17 | get { return (string)this["SessionId"]; } 18 | set { this["SessionId"] = value; } 19 | } 20 | 21 | [ConfigurationProperty("BaseUrl", DefaultValue = "https://app.files.com/")] 22 | public string BaseUrl 23 | { 24 | get { return (string)this["BaseUrl"]; } 25 | set { this["BaseUrl"] = value; } 26 | } 27 | 28 | [ConfigurationProperty("Language")] 29 | public string Language 30 | { 31 | get { return (string)this["Language"]; } 32 | set { this["Language"] = value; } 33 | } 34 | 35 | [ConfigurationProperty("ConnectTimeout", DefaultValue = 30)] 36 | public int ConnectTimeout 37 | { 38 | get { return (int)this["ConnectTimeout"]; } 39 | set { this["ConnectTimeout"] = value; } 40 | } 41 | 42 | [ConfigurationProperty("ReadTimeout", DefaultValue = 60)] 43 | public int ReadTimeout 44 | { 45 | get { return (int)this["ReadTimeout"]; } 46 | set { this["ReadTimeout"] = value; } 47 | } 48 | 49 | [ConfigurationProperty("InitialNetworkRequestDelay", DefaultValue = 0.5D)] 50 | public double InitialNetworkRequestDelay 51 | { 52 | get { return (double)this["InitialNetworkRequestDelay"]; } 53 | set { this["InitialNetworkRequestDelay"] = value; } 54 | } 55 | 56 | [ConfigurationProperty("MaxNetworkRetries", DefaultValue = 3)] 57 | public int MaxNetworkRetries 58 | { 59 | get { return (int)this["MaxNetworkRetries"]; } 60 | set { this["MaxNetworkRetries"] = value; } 61 | } 62 | 63 | [ConfigurationProperty("MaxNetworkRetryDelay", DefaultValue = 2.0D)] 64 | public double MaxNetworkRetryDelay 65 | { 66 | get { return (double)this["MaxNetworkRetryDelay"]; } 67 | set { this["MaxNetworkRetryDelay"] = value; } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /docs/ActionNotificationExportResult.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.ActionNotificationExportResult 2 | 3 | ## Example ActionNotificationExportResult Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "created_at": 1, 9 | "status": 200, 10 | "message": "Success", 11 | "success": true, 12 | "request_headers": "{\"User-Agent\":\"Files.com Webhook\"}", 13 | "request_method": "GET", 14 | "request_url": "www.example.com/webhook_receiver", 15 | "path": "MyFolder/MyFile.txt", 16 | "folder": "MyFolder" 17 | } 18 | ``` 19 | 20 | * `id` / `Id` (Nullable<Int64>): Notification ID 21 | * `created_at` / `CreatedAt` (Nullable<Int64>): When the notification was sent. 22 | * `status` / `Status` (Nullable<Int64>): HTTP status code returned in the webhook response. 23 | * `message` / `Message` (string): A message indicating the overall status of the webhook notification. 24 | * `success` / `Success` (bool): `true` if the webhook succeeded by receiving a 200 or 204 response. 25 | * `request_headers` / `RequestHeaders` (string): A JSON-encoded string with headers that were sent with the webhook. 26 | * `request_method` / `RequestMethod` (string): The HTTP verb used to perform the webhook. 27 | * `request_url` / `RequestUrl` (string): The webhook request URL. 28 | * `path` / `Path` (string): The path to the actual file that triggered this notification. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 29 | * `folder` / `Folder` (string): The folder associated with the triggering action for this notification. 30 | 31 | 32 | --- 33 | 34 | ## List Action Notification Export Results 35 | 36 | ``` 37 | Task<FilesList<ActionNotificationExportResult>> ActionNotificationExportResult.List( 38 | 39 | Dictionary<string, object> parameters = null, 40 | Dictionary<string, object> options = null 41 | ) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 47 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 48 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 49 | * `action_notification_export_id` (Nullable<Int64>): Required - ID of the associated action notification export. 50 | -------------------------------------------------------------------------------- /docs/InboxRecipient.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.InboxRecipient 2 | 3 | ## Example InboxRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` / `Company` (string): The recipient's company. 16 | * `name` / `Name` (string): The recipient's name. 17 | * `note` / `Note` (string): A note sent to the recipient with the inbox. 18 | * `recipient` / `Recipient` (string): The recipient's email address. 19 | * `sent_at` / `SentAt` (Nullable<DateTime>): When the Inbox was shared with this recipient. 20 | * `inbox_id` / `InboxId` (Nullable<Int64>): Inbox to share. 21 | * `share_after_create` / `ShareAfterCreate` (bool): Set to true to share the link with the recipient upon creation. 22 | 23 | 24 | --- 25 | 26 | ## List Inbox Recipients 27 | 28 | ``` 29 | Task<FilesList<InboxRecipient>> InboxRecipient.List( 30 | 31 | Dictionary<string, object> parameters = null, 32 | Dictionary<string, object> options = null 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 41 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 42 | * `inbox_id` (Nullable<Int64>): Required - List recipients for the inbox with this ID. 43 | 44 | 45 | --- 46 | 47 | ## Create Inbox Recipient 48 | 49 | ``` 50 | Task<InboxRecipient> InboxRecipient.Create( 51 | 52 | Dictionary<string, object> parameters = null, 53 | Dictionary<string, object> options = null 54 | ) 55 | ``` 56 | 57 | ### Parameters 58 | 59 | * `inbox_id` (Nullable<Int64>): Required - Inbox to share. 60 | * `recipient` (string): Required - Email address to share this inbox with. 61 | * `name` (string): Name of recipient. 62 | * `company` (string): Company of recipient. 63 | * `note` (string): Note to include in email. 64 | * `share_after_create` (bool): Set to true to share the link with the recipient upon creation. 65 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/Errors.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class Errors 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public Errors() : this(null, null) { } 16 | 17 | public Errors(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("fields")) 33 | { 34 | this.attributes.Add("fields", new string[0]); 35 | } 36 | if (!this.attributes.ContainsKey("messages")) 37 | { 38 | this.attributes.Add("messages", new string[0]); 39 | } 40 | } 41 | 42 | public Dictionary<string, object> getAttributes() 43 | { 44 | return new Dictionary<string, object>(this.attributes); 45 | } 46 | 47 | public object GetOption(string name) 48 | { 49 | return (this.options.ContainsKey(name) ? this.options[name] : null); 50 | } 51 | 52 | public void SetOption(string name, object value) 53 | { 54 | this.options[name] = value; 55 | } 56 | 57 | 58 | /// <summary> 59 | /// A list of fields where errors occur 60 | /// </summary> 61 | [JsonInclude] 62 | [JsonPropertyName("fields")] 63 | public string[] Fields 64 | { 65 | get { return (string[])attributes["fields"]; } 66 | private set { attributes["fields"] = value; } 67 | } 68 | 69 | /// <summary> 70 | /// A list of error messages 71 | /// </summary> 72 | [JsonInclude] 73 | [JsonPropertyName("messages")] 74 | public string[] Messages 75 | { 76 | get { return (string[])attributes["messages"]; } 77 | private set { attributes["messages"] = value; } 78 | } 79 | 80 | 81 | 82 | } 83 | } -------------------------------------------------------------------------------- /docs/BundleRegistration.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BundleRegistration 2 | 3 | ## Example BundleRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "inbox_code": "abc123", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "bundle_code": "example", 19 | "bundle_id": 1, 20 | "bundle_recipient_id": 1, 21 | "created_at": "2000-01-01T01:00:00Z" 22 | } 23 | ``` 24 | 25 | * `code` / `Code` (string): Registration cookie code 26 | * `name` / `Name` (string): Registrant name 27 | * `company` / `Company` (string): Registrant company name 28 | * `email` / `Email` (string): Registrant email address 29 | * `ip` / `Ip` (string): Registrant IP Address 30 | * `inbox_code` / `InboxCode` (string): InboxRegistration cookie code, if there is an associated InboxRegistration 31 | * `clickwrap_body` / `ClickwrapBody` (string): Clickwrap text that was shown to the registrant 32 | * `form_field_set_id` / `FormFieldSetId` (Nullable<Int64>): Id of associated form field set 33 | * `form_field_data` / `FormFieldData` (object): Data for form field set with form field ids as keys and user data as values 34 | * `bundle_code` / `BundleCode` (string): Bundle URL code 35 | * `bundle_id` / `BundleId` (Nullable<Int64>): Id of associated bundle 36 | * `bundle_recipient_id` / `BundleRecipientId` (Nullable<Int64>): Id of associated bundle recipient 37 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Registration creation date/time 38 | 39 | 40 | --- 41 | 42 | ## List Share Link Registrations 43 | 44 | ``` 45 | Task<FilesList<BundleRegistration>> BundleRegistration.List( 46 | 47 | Dictionary<string, object> parameters = null, 48 | Dictionary<string, object> options = null 49 | ) 50 | ``` 51 | 52 | ### Parameters 53 | 54 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 55 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 56 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 57 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id` and `created_at`. 58 | * `bundle_id` (Nullable<Int64>): ID of the associated Bundle 59 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/FileAction.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class FileAction 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public FileAction() : this(null, null) { } 16 | 17 | public FileAction(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("status")) 33 | { 34 | this.attributes.Add("status", null); 35 | } 36 | if (!this.attributes.ContainsKey("file_migration_id")) 37 | { 38 | this.attributes.Add("file_migration_id", null); 39 | } 40 | } 41 | 42 | public Dictionary<string, object> getAttributes() 43 | { 44 | return new Dictionary<string, object>(this.attributes); 45 | } 46 | 47 | public object GetOption(string name) 48 | { 49 | return (this.options.ContainsKey(name) ? this.options[name] : null); 50 | } 51 | 52 | public void SetOption(string name, object value) 53 | { 54 | this.options[name] = value; 55 | } 56 | 57 | 58 | /// <summary> 59 | /// Status of file operation. 60 | /// </summary> 61 | [JsonInclude] 62 | [JsonPropertyName("status")] 63 | public string Status 64 | { 65 | get { return (string)attributes["status"]; } 66 | private set { attributes["status"] = value; } 67 | } 68 | 69 | /// <summary> 70 | /// If status is pending, this is the id of the File Migration to check for status updates. 71 | /// </summary> 72 | [JsonInclude] 73 | [JsonPropertyName("file_migration_id")] 74 | public Nullable<Int64> FileMigrationId 75 | { 76 | get { return (Nullable<Int64>)attributes["file_migration_id"]; } 77 | private set { attributes["file_migration_id"] = value; } 78 | } 79 | 80 | 81 | 82 | } 83 | } -------------------------------------------------------------------------------- /docs/BandwidthSnapshot.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BandwidthSnapshot 2 | 3 | ## Example BandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "bytes_received": 1.0, 9 | "bytes_sent": 1.0, 10 | "sync_bytes_received": 1.0, 11 | "sync_bytes_sent": 1.0, 12 | "requests_get": 1.0, 13 | "requests_put": 1.0, 14 | "requests_other": 1.0, 15 | "logged_at": "2000-01-01T01:00:00Z" 16 | } 17 | ``` 18 | 19 | * `id` / `Id` (Nullable<Int64>): Site bandwidth ID 20 | * `bytes_received` / `BytesReceived` (double): Site bandwidth report bytes received 21 | * `bytes_sent` / `BytesSent` (double): Site bandwidth report bytes sent 22 | * `sync_bytes_received` / `SyncBytesReceived` (double): Site sync bandwidth report bytes received 23 | * `sync_bytes_sent` / `SyncBytesSent` (double): Site sync bandwidth report bytes sent 24 | * `requests_get` / `RequestsGet` (double): Site bandwidth report get requests 25 | * `requests_put` / `RequestsPut` (double): Site bandwidth report put requests 26 | * `requests_other` / `RequestsOther` (double): Site bandwidth report other requests 27 | * `logged_at` / `LoggedAt` (Nullable<DateTime>): Time the site bandwidth report was logged 28 | 29 | 30 | --- 31 | 32 | ## List Bandwidth Snapshots 33 | 34 | ``` 35 | Task<FilesList<BandwidthSnapshot>> BandwidthSnapshot.List( 36 | 37 | Dictionary<string, object> parameters = null, 38 | Dictionary<string, object> options = null 39 | ) 40 | ``` 41 | 42 | ### Parameters 43 | 44 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 45 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 46 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 47 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 48 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 49 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 50 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 51 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 52 | -------------------------------------------------------------------------------- /docs/InboxUpload.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.InboxUpload 2 | 3 | ## Example InboxUpload Object 4 | 5 | ``` 6 | { 7 | "inbox_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "inbox_id": 1, 19 | "inbox_recipient_id": 1, 20 | "inbox_title": "example", 21 | "created_at": "2000-01-01T01:00:00Z" 22 | }, 23 | "path": "a/b/test.txt", 24 | "created_at": "2000-01-01T01:00:00Z" 25 | } 26 | ``` 27 | 28 | * `inbox_registration` / `InboxRegistration` (InboxRegistration): 29 | * `path` / `Path` (string): Upload path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 30 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Upload date/time 31 | 32 | 33 | --- 34 | 35 | ## List Inbox Uploads 36 | 37 | ``` 38 | Task<FilesList<InboxUpload>> InboxUpload.List( 39 | 40 | Dictionary<string, object> parameters = null, 41 | Dictionary<string, object> options = null 42 | ) 43 | ``` 44 | 45 | ### Parameters 46 | 47 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 48 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 49 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 50 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `inbox_registration_id`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ inbox_registration_id, created_at ]`, `[ folder_behavior_id, inbox_registration_id ]` or `[ folder_behavior_id, inbox_registration_id, created_at ]`. 51 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 52 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 53 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 54 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 55 | -------------------------------------------------------------------------------- /examples/files-cli/Commands/BaseCommand.cs: -------------------------------------------------------------------------------- 1 | using ManyConsole; 2 | using System; 3 | using System.Threading.Tasks; 4 | using FilesCom.Models; 5 | using System.Collections.Generic; 6 | 7 | namespace files_cli.Commands 8 | { 9 | public abstract class BaseCommand : ConsoleCommand 10 | { 11 | protected const int Success = 0; 12 | protected const int Failure = 2; 13 | 14 | public string Username { get; set; } 15 | public string Password { get; set; } 16 | public string Otp { get; set; } 17 | 18 | public BaseCommand() 19 | { 20 | Username = null; 21 | Password = null; 22 | Otp = null; 23 | 24 | HasOption("u|user=", "The username to use for session authentication.", username => Username = username); 25 | HasOption("p|password=", "The password to use for session authentication.", password => Password = password); 26 | HasOption("o|otp=", "A One-Time Password if 2FA is enabled.", otp => Otp = otp); 27 | } 28 | 29 | public async Task<Dictionary<string, object>> GetOptions() 30 | { 31 | Dictionary<string, object> options = new Dictionary<string, object>(); 32 | 33 | if (Username != null) { 34 | if (Password == null) { 35 | Console.WriteLine("username and password must both be present for session authentication"); 36 | } 37 | 38 | var parameters = new Dictionary<string, object>(); 39 | parameters.Add("username", Username); 40 | parameters.Add("password", Password); 41 | if (Otp != null) 42 | { 43 | parameters.Add("otp", Otp); 44 | } 45 | 46 | Session session = await Session.Create(parameters); 47 | options.Add("session_id", session.Id); 48 | } 49 | 50 | return options; 51 | } 52 | 53 | public virtual async Task<int> RunAsync(string[] remainingArguments) 54 | { 55 | return await Task.Run(() => { return Failure; }); 56 | } 57 | 58 | public override int Run(string[] remainingArguments) 59 | { 60 | int result = Failure; 61 | 62 | Task.Run(async () => 63 | { 64 | try 65 | { 66 | result = await RunAsync(remainingArguments); 67 | } 68 | catch (Exception e) 69 | { 70 | Console.Error.WriteLine(e.Message); 71 | Console.Error.WriteLine(e.StackTrace); 72 | } 73 | }).GetAwaiter().GetResult(); 74 | 75 | return result; 76 | } 77 | } 78 | } 79 | 80 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/BundlePath.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class BundlePath 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public BundlePath() : this(null, null) { } 16 | 17 | public BundlePath(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("recursive")) 33 | { 34 | this.attributes.Add("recursive", false); 35 | } 36 | if (!this.attributes.ContainsKey("path")) 37 | { 38 | this.attributes.Add("path", null); 39 | } 40 | } 41 | 42 | public Dictionary<string, object> getAttributes() 43 | { 44 | return new Dictionary<string, object>(this.attributes); 45 | } 46 | 47 | public object GetOption(string name) 48 | { 49 | return (this.options.ContainsKey(name) ? this.options[name] : null); 50 | } 51 | 52 | public void SetOption(string name, object value) 53 | { 54 | this.options[name] = value; 55 | } 56 | 57 | 58 | /// <summary> 59 | /// Allow access to subfolders content? 60 | /// </summary> 61 | [JsonInclude] 62 | [JsonConverter(typeof(BooleanJsonConverter))] 63 | [JsonPropertyName("recursive")] 64 | public bool Recursive 65 | { 66 | get { return attributes["recursive"] == null ? false : (bool)attributes["recursive"]; } 67 | private set { attributes["recursive"] = value; } 68 | } 69 | 70 | /// <summary> 71 | /// The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 72 | /// </summary> 73 | [JsonInclude] 74 | [JsonPropertyName("path")] 75 | public string Path 76 | { 77 | get { return (string)attributes["path"]; } 78 | private set { attributes["path"] = value; } 79 | } 80 | 81 | 82 | 83 | } 84 | } -------------------------------------------------------------------------------- /docs/BundleDownload.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BundleDownload 2 | 3 | ## Example BundleDownload Object 4 | 5 | ``` 6 | { 7 | "bundle_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "inbox_code": "abc123", 14 | "clickwrap_body": "example", 15 | "form_field_set_id": 1, 16 | "form_field_data": { 17 | "key": "example value" 18 | }, 19 | "bundle_code": "example", 20 | "bundle_id": 1, 21 | "bundle_recipient_id": 1, 22 | "created_at": "2000-01-01T01:00:00Z" 23 | }, 24 | "download_method": "file", 25 | "path": "a/b/test.txt", 26 | "created_at": "2000-01-01T01:00:00Z" 27 | } 28 | ``` 29 | 30 | * `bundle_registration` / `BundleRegistration` (BundleRegistration): 31 | * `download_method` / `DownloadMethod` (string): Download method (file or full_zip) 32 | * `path` / `Path` (string): Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 33 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Download date/time 34 | 35 | 36 | --- 37 | 38 | ## List Share Link Downloads 39 | 40 | ``` 41 | Task<FilesList<BundleDownload>> BundleDownload.List( 42 | 43 | Dictionary<string, object> parameters = null, 44 | Dictionary<string, object> options = null 45 | ) 46 | ``` 47 | 48 | ### Parameters 49 | 50 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 51 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 53 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`. 54 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 55 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 56 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 57 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 58 | * `bundle_id` (Nullable<Int64>): Bundle ID 59 | * `bundle_registration_id` (Nullable<Int64>): BundleRegistration ID 60 | -------------------------------------------------------------------------------- /docs/UserRequest.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UserRequest 2 | 3 | ## Example UserRequest Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "John Doe", 9 | "email": "john.doe@files.com", 10 | "details": "Changed Departments", 11 | "company": "Acme Inc." 12 | } 13 | ``` 14 | 15 | * `id` / `Id` (Nullable<Int64>): ID 16 | * `name` / `Name` (string): User's full name 17 | * `email` / `Email` (string): User email address 18 | * `details` / `Details` (string): Details of the user's request 19 | * `company` / `Company` (string): User's company name 20 | 21 | 22 | --- 23 | 24 | ## List User Requests 25 | 26 | ``` 27 | Task<FilesList<UserRequest>> UserRequest.List( 28 | 29 | Dictionary<string, object> parameters = null, 30 | Dictionary<string, object> options = null 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 37 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 38 | 39 | 40 | --- 41 | 42 | ## Show User Request 43 | 44 | ``` 45 | Task<UserRequest> UserRequest.Find( 46 | Nullable<Int64> id, 47 | Dictionary<string, object> parameters = null, 48 | Dictionary<string, object> options = null 49 | ) 50 | ``` 51 | 52 | ### Parameters 53 | 54 | * `id` (Nullable<Int64>): Required - User Request ID. 55 | 56 | 57 | --- 58 | 59 | ## Create User Request 60 | 61 | ``` 62 | Task<UserRequest> UserRequest.Create( 63 | 64 | Dictionary<string, object> parameters = null, 65 | Dictionary<string, object> options = null 66 | ) 67 | ``` 68 | 69 | ### Parameters 70 | 71 | * `name` (string): Required - Name of user requested 72 | * `email` (string): Required - Email of user requested 73 | * `details` (string): Required - Details of the user request 74 | * `company` (string): Company of the user requested 75 | 76 | 77 | --- 78 | 79 | ## Delete User Request 80 | 81 | ``` 82 | Task UserRequest.Delete( 83 | Nullable<Int64> id, 84 | Dictionary<string, object> parameters = null, 85 | Dictionary<string, object> options = null 86 | ) 87 | ``` 88 | 89 | ### Parameters 90 | 91 | * `id` (Nullable<Int64>): Required - User Request ID. 92 | 93 | 94 | --- 95 | 96 | ## Delete User Request 97 | 98 | ``` 99 | var UserRequest = UserRequest.Find(1); 100 | 101 | var parameters = new Dictionary<string, object>(); 102 | 103 | 104 | UserRequest.Delete 105 | ``` 106 | 107 | ### Parameters 108 | 109 | * `id` (Nullable<Int64>): Required - User Request ID. 110 | -------------------------------------------------------------------------------- /docs/MessageReaction.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.MessageReaction 2 | 3 | ## Example MessageReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` / `Id` (Nullable<Int64>): Reaction ID 13 | * `emoji` / `Emoji` (string): Emoji used in the reaction. 14 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | 17 | --- 18 | 19 | ## List Message Reactions 20 | 21 | ``` 22 | Task<FilesList<MessageReaction>> MessageReaction.List( 23 | 24 | Dictionary<string, object> parameters = null, 25 | Dictionary<string, object> options = null 26 | ) 27 | ``` 28 | 29 | ### Parameters 30 | 31 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 32 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 33 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | * `message_id` (Nullable<Int64>): Required - Message to return reactions for. 35 | 36 | 37 | --- 38 | 39 | ## Show Message Reaction 40 | 41 | ``` 42 | Task<MessageReaction> MessageReaction.Find( 43 | Nullable<Int64> id, 44 | Dictionary<string, object> parameters = null, 45 | Dictionary<string, object> options = null 46 | ) 47 | ``` 48 | 49 | ### Parameters 50 | 51 | * `id` (Nullable<Int64>): Required - Message Reaction ID. 52 | 53 | 54 | --- 55 | 56 | ## Create Message Reaction 57 | 58 | ``` 59 | Task<MessageReaction> MessageReaction.Create( 60 | 61 | Dictionary<string, object> parameters = null, 62 | Dictionary<string, object> options = null 63 | ) 64 | ``` 65 | 66 | ### Parameters 67 | 68 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 69 | * `emoji` (string): Required - Emoji to react with. 70 | 71 | 72 | --- 73 | 74 | ## Delete Message Reaction 75 | 76 | ``` 77 | Task MessageReaction.Delete( 78 | Nullable<Int64> id, 79 | Dictionary<string, object> parameters = null, 80 | Dictionary<string, object> options = null 81 | ) 82 | ``` 83 | 84 | ### Parameters 85 | 86 | * `id` (Nullable<Int64>): Required - Message Reaction ID. 87 | 88 | 89 | --- 90 | 91 | ## Delete Message Reaction 92 | 93 | ``` 94 | var MessageReaction = MessageReaction.Find(1); 95 | 96 | var parameters = new Dictionary<string, object>(); 97 | 98 | 99 | MessageReaction.Delete 100 | ``` 101 | 102 | ### Parameters 103 | 104 | * `id` (Nullable<Int64>): Required - Message Reaction ID. 105 | -------------------------------------------------------------------------------- /docs/UserCipherUse.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UserCipherUse 2 | 3 | ## Example UserCipherUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "user_id": 1, 9 | "username": "example", 10 | "protocol_cipher": "TLSv1.2; ECDHE-RSA-AES256-GCM-SHA384", 11 | "created_at": "2000-01-01T01:00:00Z", 12 | "insecure": true, 13 | "interface": "restapi", 14 | "updated_at": "2000-01-01T01:00:00Z" 15 | } 16 | ``` 17 | 18 | * `id` / `Id` (Nullable<Int64>): UserCipherUse ID 19 | * `user_id` / `UserId` (Nullable<Int64>): ID of the user who performed this access 20 | * `username` / `Username` (string): Username of the user who performed this access 21 | * `protocol_cipher` / `ProtocolCipher` (string): The protocol and cipher employed 22 | * `created_at` / `CreatedAt` (Nullable<DateTime>): The earliest recorded use of this combination of interface and protocol and cipher (for this user) 23 | * `insecure` / `Insecure` (bool): Is this cipher considered insecure? 24 | * `interface` / `Interface` (string): The interface accessed 25 | * `updated_at` / `UpdatedAt` (Nullable<DateTime>): The most recent use of this combination of interface and protocol and cipher (for this user) 26 | 27 | 28 | --- 29 | 30 | ## List User Cipher Uses 31 | 32 | ``` 33 | Task<FilesList<UserCipherUse>> UserCipherUse.List( 34 | 35 | Dictionary<string, object> parameters = null, 36 | Dictionary<string, object> options = null 37 | ) 38 | ``` 39 | 40 | ### Parameters 41 | 42 | * `user_id` (Nullable<Int64>): User ID. If provided, will return uses for this user. 43 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 44 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 45 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `updated_at`. 46 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `insecure` and `updated_at`. Valid field combinations are `[ insecure, updated_at ]`. 47 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `updated_at`. 48 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `updated_at`. 49 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `updated_at`. 50 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `updated_at`. 51 | -------------------------------------------------------------------------------- /docs/BundleRecipient.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BundleRecipient 2 | 3 | ## Example BundleRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` / `Company` (string): The recipient's company. 16 | * `name` / `Name` (string): The recipient's name. 17 | * `note` / `Note` (string): A note sent to the recipient with the bundle. 18 | * `recipient` / `Recipient` (string): The recipient's email address. 19 | * `sent_at` / `SentAt` (Nullable<DateTime>): When the Bundle was shared with this recipient. 20 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 21 | * `bundle_id` / `BundleId` (Nullable<Int64>): Bundle to share. 22 | * `share_after_create` / `ShareAfterCreate` (bool): Set to true to share the link with the recipient upon creation. 23 | 24 | 25 | --- 26 | 27 | ## List Share Link Recipients 28 | 29 | ``` 30 | Task<FilesList<BundleRecipient>> BundleRecipient.List( 31 | 32 | Dictionary<string, object> parameters = null, 33 | Dictionary<string, object> options = null 34 | ) 35 | ``` 36 | 37 | ### Parameters 38 | 39 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 40 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 41 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 43 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 44 | * `bundle_id` (Nullable<Int64>): Required - List recipients for the bundle with this ID. 45 | 46 | 47 | --- 48 | 49 | ## Create Share Link Recipient 50 | 51 | ``` 52 | Task<BundleRecipient> BundleRecipient.Create( 53 | 54 | Dictionary<string, object> parameters = null, 55 | Dictionary<string, object> options = null 56 | ) 57 | ``` 58 | 59 | ### Parameters 60 | 61 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 62 | * `bundle_id` (Nullable<Int64>): Required - Bundle to share. 63 | * `recipient` (string): Required - Email addresses to share this bundle with. 64 | * `name` (string): Name of recipient. 65 | * `company` (string): Company of recipient. 66 | * `note` (string): Note to include in email. 67 | * `share_after_create` (bool): Set to true to share the link with the recipient upon creation. 68 | -------------------------------------------------------------------------------- /docs/EmailLog.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.EmailLog 2 | 3 | ## Example EmailLog Object 4 | 5 | ``` 6 | { 7 | "timestamp": "2000-01-01T01:00:00Z", 8 | "message": "example", 9 | "status": "success", 10 | "subject": "example", 11 | "to": "example", 12 | "cc": "example", 13 | "delivery_method": "example", 14 | "smtp_hostname": "example", 15 | "smtp_ip": "example", 16 | "created_at": "2000-01-01T01:00:00Z" 17 | } 18 | ``` 19 | 20 | * `timestamp` / `Timestamp` (Nullable<DateTime>): Start Time of Action. Deprecrated: Use created_at. 21 | * `message` / `Message` (string): Log Message 22 | * `status` / `Status` (string): Status of E-Mail delivery 23 | * `subject` / `Subject` (string): Subject line of E-Mail 24 | * `to` / `To` (string): To field of E-Mail 25 | * `cc` / `Cc` (string): CC field of E-Mail 26 | * `delivery_method` / `DeliveryMethod` (string): How was the email delivered? `customer_smtp` or `files.com` 27 | * `smtp_hostname` / `SmtpHostname` (string): Customer SMTP Hostname used. 28 | * `smtp_ip` / `SmtpIp` (string): Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP). 29 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Start Time of Action 30 | 31 | 32 | --- 33 | 34 | ## List Email Logs 35 | 36 | ``` 37 | Task<FilesList<EmailLog>> EmailLog.List( 38 | 39 | Dictionary<string, object> parameters = null, 40 | Dictionary<string, object> options = null 41 | ) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 47 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 48 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`. 49 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`. 50 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`. 51 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`. 52 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ status ]`, `[ created_at ]` or `[ status, created_at ]`. 53 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/UsageByTopLevelDir.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class UsageByTopLevelDir 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public UsageByTopLevelDir() : this(null, null) { } 16 | 17 | public UsageByTopLevelDir(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("dir")) 33 | { 34 | this.attributes.Add("dir", null); 35 | } 36 | if (!this.attributes.ContainsKey("size")) 37 | { 38 | this.attributes.Add("size", null); 39 | } 40 | if (!this.attributes.ContainsKey("count")) 41 | { 42 | this.attributes.Add("count", null); 43 | } 44 | } 45 | 46 | public Dictionary<string, object> getAttributes() 47 | { 48 | return new Dictionary<string, object>(this.attributes); 49 | } 50 | 51 | public object GetOption(string name) 52 | { 53 | return (this.options.ContainsKey(name) ? this.options[name] : null); 54 | } 55 | 56 | public void SetOption(string name, object value) 57 | { 58 | this.options[name] = value; 59 | } 60 | 61 | 62 | /// <summary> 63 | /// Directory name 64 | /// </summary> 65 | [JsonInclude] 66 | [JsonPropertyName("dir")] 67 | public string Dir 68 | { 69 | get { return (string)attributes["dir"]; } 70 | private set { attributes["dir"] = value; } 71 | } 72 | 73 | /// <summary> 74 | /// Usage 75 | /// </summary> 76 | [JsonInclude] 77 | [JsonPropertyName("size")] 78 | public Nullable<Int64> Size 79 | { 80 | get { return (Nullable<Int64>)attributes["size"]; } 81 | private set { attributes["size"] = value; } 82 | } 83 | 84 | /// <summary> 85 | /// File count 86 | /// </summary> 87 | [JsonInclude] 88 | [JsonPropertyName("count")] 89 | public Nullable<Int64> Count 90 | { 91 | get { return (Nullable<Int64>)attributes["count"]; } 92 | private set { attributes["count"] = value; } 93 | } 94 | 95 | 96 | 97 | } 98 | } -------------------------------------------------------------------------------- /sdk/FilesCom/Models/ShareGroupMember.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class ShareGroupMember 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public ShareGroupMember() : this(null, null) { } 16 | 17 | public ShareGroupMember(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("name")) 33 | { 34 | this.attributes.Add("name", null); 35 | } 36 | if (!this.attributes.ContainsKey("company")) 37 | { 38 | this.attributes.Add("company", null); 39 | } 40 | if (!this.attributes.ContainsKey("email")) 41 | { 42 | this.attributes.Add("email", null); 43 | } 44 | } 45 | 46 | public Dictionary<string, object> getAttributes() 47 | { 48 | return new Dictionary<string, object>(this.attributes); 49 | } 50 | 51 | public object GetOption(string name) 52 | { 53 | return (this.options.ContainsKey(name) ? this.options[name] : null); 54 | } 55 | 56 | public void SetOption(string name, object value) 57 | { 58 | this.options[name] = value; 59 | } 60 | 61 | 62 | /// <summary> 63 | /// Name of the share group member 64 | /// </summary> 65 | [JsonInclude] 66 | [JsonPropertyName("name")] 67 | public string Name 68 | { 69 | get { return (string)attributes["name"]; } 70 | private set { attributes["name"] = value; } 71 | } 72 | 73 | /// <summary> 74 | /// Company of the share group member 75 | /// </summary> 76 | [JsonInclude] 77 | [JsonPropertyName("company")] 78 | public string Company 79 | { 80 | get { return (string)attributes["company"]; } 81 | private set { attributes["company"] = value; } 82 | } 83 | 84 | /// <summary> 85 | /// Email of the share group member 86 | /// </summary> 87 | [JsonInclude] 88 | [JsonPropertyName("email")] 89 | public string Email 90 | { 91 | get { return (string)attributes["email"]; } 92 | private set { attributes["email"] = value; } 93 | } 94 | 95 | 96 | 97 | } 98 | } -------------------------------------------------------------------------------- /docs/EmailIncomingMessage.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.EmailIncomingMessage 2 | 3 | ## Example EmailIncomingMessage Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "inbox_id": 1, 9 | "sender": "example", 10 | "sender_name": "example", 11 | "status": "success", 12 | "body": "example", 13 | "message": "example", 14 | "created_at": "2000-01-01T01:00:00Z", 15 | "inbox_title": "Inbox Title" 16 | } 17 | ``` 18 | 19 | * `id` / `Id` (Nullable<Int64>): Id of the Email Incoming Message 20 | * `inbox_id` / `InboxId` (Nullable<Int64>): Id of the Inbox associated with this message 21 | * `sender` / `Sender` (string): Sender of the email 22 | * `sender_name` / `SenderName` (string): Sender name 23 | * `status` / `Status` (string): Status of the message 24 | * `body` / `Body` (string): Body of the email 25 | * `message` / `Message` (string): Message describing the failure 26 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Message creation date/time 27 | * `inbox_title` / `InboxTitle` (string): Title of the Inbox associated with this message 28 | 29 | 30 | --- 31 | 32 | ## List Email Incoming Messages 33 | 34 | ``` 35 | Task<FilesList<EmailIncomingMessage>> EmailIncomingMessage.List( 36 | 37 | Dictionary<string, object> parameters = null, 38 | Dictionary<string, object> options = null 39 | ) 40 | ``` 41 | 42 | ### Parameters 43 | 44 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 45 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 46 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `sender`, `status` or `inbox_id`. 47 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `inbox_id`, `sender` or `status`. Valid field combinations are `[ inbox_id, created_at ]`, `[ sender, created_at ]`, `[ status, created_at ]`, `[ inbox_id, status ]`, `[ status, sender ]`, `[ inbox_id, status, created_at ]`, `[ status, sender, created_at ]`, `[ inbox_id, status, sender ]` or `[ inbox_id, status, sender, created_at ]`. 48 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 49 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 50 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `sender`. 51 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 52 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 53 | -------------------------------------------------------------------------------- /docs/MessageCommentReaction.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.MessageCommentReaction 2 | 3 | ## Example MessageCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` / `Id` (Nullable<Int64>): Reaction ID 13 | * `emoji` / `Emoji` (string): Emoji used in the reaction. 14 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | 17 | --- 18 | 19 | ## List Message Comment Reactions 20 | 21 | ``` 22 | Task<FilesList<MessageCommentReaction>> MessageCommentReaction.List( 23 | 24 | Dictionary<string, object> parameters = null, 25 | Dictionary<string, object> options = null 26 | ) 27 | ``` 28 | 29 | ### Parameters 30 | 31 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 32 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 33 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 35 | * `message_comment_id` (Nullable<Int64>): Required - Message comment to return reactions for. 36 | 37 | 38 | --- 39 | 40 | ## Show Message Comment Reaction 41 | 42 | ``` 43 | Task<MessageCommentReaction> MessageCommentReaction.Find( 44 | Nullable<Int64> id, 45 | Dictionary<string, object> parameters = null, 46 | Dictionary<string, object> options = null 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `id` (Nullable<Int64>): Required - Message Comment Reaction ID. 53 | 54 | 55 | --- 56 | 57 | ## Create Message Comment Reaction 58 | 59 | ``` 60 | Task<MessageCommentReaction> MessageCommentReaction.Create( 61 | 62 | Dictionary<string, object> parameters = null, 63 | Dictionary<string, object> options = null 64 | ) 65 | ``` 66 | 67 | ### Parameters 68 | 69 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 70 | * `emoji` (string): Required - Emoji to react with. 71 | 72 | 73 | --- 74 | 75 | ## Delete Message Comment Reaction 76 | 77 | ``` 78 | Task MessageCommentReaction.Delete( 79 | Nullable<Int64> id, 80 | Dictionary<string, object> parameters = null, 81 | Dictionary<string, object> options = null 82 | ) 83 | ``` 84 | 85 | ### Parameters 86 | 87 | * `id` (Nullable<Int64>): Required - Message Comment Reaction ID. 88 | 89 | 90 | --- 91 | 92 | ## Delete Message Comment Reaction 93 | 94 | ``` 95 | var MessageCommentReaction = MessageCommentReaction.Find(1); 96 | 97 | var parameters = new Dictionary<string, object>(); 98 | 99 | 100 | MessageCommentReaction.Delete 101 | ``` 102 | 103 | ### Parameters 104 | 105 | * `id` (Nullable<Int64>): Required - Message Comment Reaction ID. 106 | -------------------------------------------------------------------------------- /sdk/FilesCom/FilesList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Net.Http.Headers; 6 | using System.Text.Json; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom 10 | { 11 | public class FilesList<T> : IEnumerable<T> 12 | { 13 | private string path; 14 | private HttpMethod method; 15 | private Dictionary<string, object> parameters; 16 | private Dictionary<string, object> options; 17 | private string cursor; 18 | public List<T> data = new List<T>(); 19 | 20 | public FilesList(string path, HttpMethod method, Dictionary<string, object> parameters, Dictionary<string, object> options) 21 | { 22 | this.path = path; 23 | this.method = method; 24 | this.parameters = parameters; 25 | this.options = options; 26 | } 27 | 28 | public IEnumerator<T> GetEnumerator() 29 | { 30 | return this.data.GetEnumerator(); 31 | } 32 | 33 | IEnumerator IEnumerable.GetEnumerator() 34 | { 35 | return this.data.GetEnumerator(); 36 | } 37 | 38 | public bool HasNextPage { get { return cursor != null; } } 39 | 40 | public void Reset() 41 | { 42 | cursor = null; 43 | parameters.Remove("cursor"); 44 | data.Clear(); 45 | } 46 | 47 | public async Task<FilesList<T>> LoadNextPage() 48 | { 49 | if (cursor != null) 50 | { 51 | parameters["cursor"] = cursor; 52 | } 53 | using (HttpResponseMessage response = await FilesClient.SendRequest(path, method, parameters, options)) 54 | { 55 | string body = await response.Content.ReadAsStringAsync(); 56 | try 57 | { 58 | data = JsonSerializer.Deserialize<List<T>>(body); 59 | } 60 | catch (JsonException) 61 | { 62 | throw new InvalidResponseException("Unexpected data received from uri: " + body); 63 | } 64 | if (response.Headers.Contains("X-Files-Cursor")) 65 | { 66 | cursor = new List<string>(response.Headers.GetValues("X-Files-Cursor"))[0]; 67 | } 68 | else 69 | { 70 | cursor = null; 71 | } 72 | } 73 | return this; 74 | } 75 | 76 | public FilesListEnumerator<T> ListAutoPaging() 77 | { 78 | return new FilesListEnumerator<T>(this); 79 | } 80 | 81 | public async Task<List<T>> All() 82 | { 83 | List<T> allData = new List<T>(); 84 | 85 | // Force starting from the beginning 86 | cursor = null; 87 | 88 | do 89 | { 90 | await LoadNextPage(); 91 | allData.AddRange(data); 92 | } while (cursor != null); 93 | 94 | return allData; 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /docs/Invoice.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Invoice 2 | 3 | ## Example Invoice Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "id": 1, 16 | "amount": 1.0, 17 | "created_at": "2000-01-01T01:00:00Z", 18 | "description": "Service from 2019-01-01 through 2019-12-31", 19 | "type": "invoice", 20 | "service_end_at": "2000-01-01T01:00:00Z", 21 | "service_start_at": "2000-01-01T01:00:00Z", 22 | "plan": "Premier", 23 | "site": "My site", 24 | "prepaid_bytes": 1, 25 | "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z", 26 | "prepaid_bytes_used": 1, 27 | "prepaid_bytes_available": 1 28 | } 29 | ], 30 | "method": "paypal", 31 | "payment_line_items": [ 32 | { 33 | "amount": 1.0, 34 | "created_at": "2000-01-01T01:00:00Z", 35 | "invoice_id": 1, 36 | "payment_id": 1 37 | } 38 | ], 39 | "payment_reversed_at": "2000-01-01T01:00:00Z", 40 | "payment_type": "example", 41 | "site_name": "My Site", 42 | "type": "invoice" 43 | } 44 | ``` 45 | 46 | * `id` / `Id` (Nullable<Int64>): Line item Id 47 | * `amount` / `Amount` (double): Line item amount 48 | * `balance` / `Balance` (double): Line item balance 49 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Line item created at 50 | * `currency` / `Currency` (string): Line item currency 51 | * `download_uri` / `DownloadUri` (string): Line item download uri 52 | * `invoice_line_items` / `InvoiceLineItems` (object[]): Associated invoice line items 53 | * `method` / `Method` (string): Line item payment method 54 | * `payment_line_items` / `PaymentLineItems` (object[]): Associated payment line items 55 | * `payment_reversed_at` / `PaymentReversedAt` (Nullable<DateTime>): Date/time payment was reversed if applicable 56 | * `payment_type` / `PaymentType` (string): Type of payment if applicable 57 | * `site_name` / `SiteName` (string): Site name this line item is for 58 | * `type` / `Type` (string): Type of line item, either payment or invoice 59 | 60 | 61 | --- 62 | 63 | ## List Invoices 64 | 65 | ``` 66 | Task<FilesList<AccountLineItem>> Invoice.List( 67 | 68 | Dictionary<string, object> parameters = null, 69 | Dictionary<string, object> options = null 70 | ) 71 | ``` 72 | 73 | ### Parameters 74 | 75 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 76 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 77 | 78 | 79 | --- 80 | 81 | ## Show Invoice 82 | 83 | ``` 84 | Task<AccountLineItem> Invoice.Find( 85 | Nullable<Int64> id, 86 | Dictionary<string, object> parameters = null, 87 | Dictionary<string, object> options = null 88 | ) 89 | ``` 90 | 91 | ### Parameters 92 | 93 | * `id` (Nullable<Int64>): Required - Invoice ID. 94 | -------------------------------------------------------------------------------- /docs/Payment.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Payment 2 | 3 | ## Example Payment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "id": 1, 16 | "amount": 1.0, 17 | "created_at": "2000-01-01T01:00:00Z", 18 | "description": "Service from 2019-01-01 through 2019-12-31", 19 | "type": "invoice", 20 | "service_end_at": "2000-01-01T01:00:00Z", 21 | "service_start_at": "2000-01-01T01:00:00Z", 22 | "plan": "Premier", 23 | "site": "My site", 24 | "prepaid_bytes": 1, 25 | "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z", 26 | "prepaid_bytes_used": 1, 27 | "prepaid_bytes_available": 1 28 | } 29 | ], 30 | "method": "paypal", 31 | "payment_line_items": [ 32 | { 33 | "amount": 1.0, 34 | "created_at": "2000-01-01T01:00:00Z", 35 | "invoice_id": 1, 36 | "payment_id": 1 37 | } 38 | ], 39 | "payment_reversed_at": "2000-01-01T01:00:00Z", 40 | "payment_type": "example", 41 | "site_name": "My Site", 42 | "type": "invoice" 43 | } 44 | ``` 45 | 46 | * `id` / `Id` (Nullable<Int64>): Line item Id 47 | * `amount` / `Amount` (double): Line item amount 48 | * `balance` / `Balance` (double): Line item balance 49 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Line item created at 50 | * `currency` / `Currency` (string): Line item currency 51 | * `download_uri` / `DownloadUri` (string): Line item download uri 52 | * `invoice_line_items` / `InvoiceLineItems` (object[]): Associated invoice line items 53 | * `method` / `Method` (string): Line item payment method 54 | * `payment_line_items` / `PaymentLineItems` (object[]): Associated payment line items 55 | * `payment_reversed_at` / `PaymentReversedAt` (Nullable<DateTime>): Date/time payment was reversed if applicable 56 | * `payment_type` / `PaymentType` (string): Type of payment if applicable 57 | * `site_name` / `SiteName` (string): Site name this line item is for 58 | * `type` / `Type` (string): Type of line item, either payment or invoice 59 | 60 | 61 | --- 62 | 63 | ## List Payments 64 | 65 | ``` 66 | Task<FilesList<AccountLineItem>> Payment.List( 67 | 68 | Dictionary<string, object> parameters = null, 69 | Dictionary<string, object> options = null 70 | ) 71 | ``` 72 | 73 | ### Parameters 74 | 75 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 76 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 77 | 78 | 79 | --- 80 | 81 | ## Show Payment 82 | 83 | ``` 84 | Task<AccountLineItem> Payment.Find( 85 | Nullable<Int64> id, 86 | Dictionary<string, object> parameters = null, 87 | Dictionary<string, object> options = null 88 | ) 89 | ``` 90 | 91 | ### Parameters 92 | 93 | * `id` (Nullable<Int64>): Required - Payment ID. 94 | -------------------------------------------------------------------------------- /docs/FileComment.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.FileComment 2 | 3 | ## Example FileComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great file!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` / `Id` (Nullable<Int64>): File Comment ID 19 | * `body` / `Body` (string): Comment body. 20 | * `reactions` / `Reactions` (object[]): Reactions to this comment. 21 | * `path` / `Path` (string): File path. 22 | 23 | 24 | --- 25 | 26 | ## List File Comments by Path 27 | 28 | ``` 29 | Task<FilesList<FileComment>> FileComment.ListFor( 30 | string path, 31 | Dictionary<string, object> parameters = null, 32 | Dictionary<string, object> options = null 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `path` (string): Required - Path to operate on. 41 | 42 | 43 | --- 44 | 45 | ## Create File Comment 46 | 47 | ``` 48 | Task<FileComment> FileComment.Create( 49 | 50 | Dictionary<string, object> parameters = null, 51 | Dictionary<string, object> options = null 52 | ) 53 | ``` 54 | 55 | ### Parameters 56 | 57 | * `body` (string): Required - Comment body. 58 | * `path` (string): Required - File path. 59 | 60 | 61 | --- 62 | 63 | ## Update File Comment 64 | 65 | ``` 66 | Task<FileComment> FileComment.Update( 67 | Nullable<Int64> id, 68 | Dictionary<string, object> parameters = null, 69 | Dictionary<string, object> options = null 70 | ) 71 | ``` 72 | 73 | ### Parameters 74 | 75 | * `id` (Nullable<Int64>): Required - File Comment ID. 76 | * `body` (string): Required - Comment body. 77 | 78 | 79 | --- 80 | 81 | ## Delete File Comment 82 | 83 | ``` 84 | Task FileComment.Delete( 85 | Nullable<Int64> id, 86 | Dictionary<string, object> parameters = null, 87 | Dictionary<string, object> options = null 88 | ) 89 | ``` 90 | 91 | ### Parameters 92 | 93 | * `id` (Nullable<Int64>): Required - File Comment ID. 94 | 95 | 96 | --- 97 | 98 | ## Update File Comment 99 | 100 | ``` 101 | var FileComment = FileComment.ListFor(path)[0]; 102 | 103 | var parameters = new Dictionary<string, object>(); 104 | 105 | parameters.Add("body", "body"); 106 | 107 | FileComment.Update(parameters); 108 | ``` 109 | 110 | ### Parameters 111 | 112 | * `id` (Nullable<Int64>): Required - File Comment ID. 113 | * `body` (string): Required - Comment body. 114 | 115 | 116 | --- 117 | 118 | ## Delete File Comment 119 | 120 | ``` 121 | var FileComment = FileComment.ListFor(path)[0]; 122 | 123 | var parameters = new Dictionary<string, object>(); 124 | 125 | 126 | FileComment.Delete 127 | ``` 128 | 129 | ### Parameters 130 | 131 | * `id` (Nullable<Int64>): Required - File Comment ID. 132 | -------------------------------------------------------------------------------- /docs/Project.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Project 2 | 3 | ## Example Project Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "global_access": "none" 9 | } 10 | ``` 11 | 12 | * `id` / `Id` (Nullable<Int64>): Project ID 13 | * `global_access` / `GlobalAccess` (string): Global access settings 14 | 15 | 16 | --- 17 | 18 | ## List Projects 19 | 20 | ``` 21 | Task<FilesList<Project>> Project.List( 22 | 23 | Dictionary<string, object> parameters = null, 24 | Dictionary<string, object> options = null 25 | ) 26 | ``` 27 | 28 | ### Parameters 29 | 30 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 31 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 32 | 33 | 34 | --- 35 | 36 | ## Show Project 37 | 38 | ``` 39 | Task<Project> Project.Find( 40 | Nullable<Int64> id, 41 | Dictionary<string, object> parameters = null, 42 | Dictionary<string, object> options = null 43 | ) 44 | ``` 45 | 46 | ### Parameters 47 | 48 | * `id` (Nullable<Int64>): Required - Project ID. 49 | 50 | 51 | --- 52 | 53 | ## Create Project 54 | 55 | ``` 56 | Task<Project> Project.Create( 57 | 58 | Dictionary<string, object> parameters = null, 59 | Dictionary<string, object> options = null 60 | ) 61 | ``` 62 | 63 | ### Parameters 64 | 65 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 66 | 67 | 68 | --- 69 | 70 | ## Update Project 71 | 72 | ``` 73 | Task<Project> Project.Update( 74 | Nullable<Int64> id, 75 | Dictionary<string, object> parameters = null, 76 | Dictionary<string, object> options = null 77 | ) 78 | ``` 79 | 80 | ### Parameters 81 | 82 | * `id` (Nullable<Int64>): Required - Project ID. 83 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 84 | 85 | 86 | --- 87 | 88 | ## Delete Project 89 | 90 | ``` 91 | Task Project.Delete( 92 | Nullable<Int64> id, 93 | Dictionary<string, object> parameters = null, 94 | Dictionary<string, object> options = null 95 | ) 96 | ``` 97 | 98 | ### Parameters 99 | 100 | * `id` (Nullable<Int64>): Required - Project ID. 101 | 102 | 103 | --- 104 | 105 | ## Update Project 106 | 107 | ``` 108 | var Project = Project.Find(1); 109 | 110 | var parameters = new Dictionary<string, object>(); 111 | 112 | parameters.Add("global_access", "global_access"); 113 | 114 | Project.Update(parameters); 115 | ``` 116 | 117 | ### Parameters 118 | 119 | * `id` (Nullable<Int64>): Required - Project ID. 120 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 121 | 122 | 123 | --- 124 | 125 | ## Delete Project 126 | 127 | ``` 128 | var Project = Project.Find(1); 129 | 130 | var parameters = new Dictionary<string, object>(); 131 | 132 | 133 | Project.Delete 134 | ``` 135 | 136 | ### Parameters 137 | 138 | * `id` (Nullable<Int64>): Required - Project ID. 139 | -------------------------------------------------------------------------------- /docs/RemoteServerConfigurationFile.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.RemoteServerConfigurationFile 2 | 3 | ## Example RemoteServerConfigurationFile Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "permission_set": "example", 9 | "private_key": "example", 10 | "subdomain": "example", 11 | "root": "C:\\Users\\", 12 | "follow_links": true, 13 | "prefer_protocol": "example", 14 | "dns": "example", 15 | "proxy_all_outbound": true, 16 | "endpoint_override": "example", 17 | "log_file": "example", 18 | "log_level": "example", 19 | "log_rotate_num": 1, 20 | "log_rotate_size": 1, 21 | "override_max_concurrent_jobs": 1, 22 | "graceful_shutdown_timeout": 1, 23 | "transfer_rate_limit": "example", 24 | "auto_update_policy": "example", 25 | "api_token": "example", 26 | "port": 1, 27 | "hostname": "example", 28 | "public_key": "example", 29 | "status": "example", 30 | "server_host_key": "example", 31 | "config_version": "example" 32 | } 33 | ``` 34 | 35 | * `id` / `Id` (Nullable<Int64>): The remote server ID of the agent 36 | * `permission_set` / `PermissionSet` (string): The permission set for the agent ['read_write', 'read_only', 'write_only'] 37 | * `private_key` / `PrivateKey` (string): The private key for the agent 38 | * `subdomain` / `Subdomain` (string): Files.com subdomain site name 39 | * `root` / `Root` (string): The root directory for the agent 40 | * `follow_links` / `FollowLinks` (bool): Follow symlinks when traversing directories 41 | * `prefer_protocol` / `PreferProtocol` (string): Preferred network protocol ['udp', 'tcp'] (default udp) 42 | * `dns` / `Dns` (string): DNS lookup method ['auto','doh','system'] (default auto) 43 | * `proxy_all_outbound` / `ProxyAllOutbound` (bool): Proxy all outbound traffic through files.com proxy server 44 | * `endpoint_override` / `EndpointOverride` (string): Custom site endpoint URL 45 | * `log_file` / `LogFile` (string): Log file name and location 46 | * `log_level` / `LogLevel` (string): Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal'] (default info) 47 | * `log_rotate_num` / `LogRotateNum` (Nullable<Int64>): Log route for agent logs. (default 5) 48 | * `log_rotate_size` / `LogRotateSize` (Nullable<Int64>): Log route size in MB for agent logs. (default 20) 49 | * `override_max_concurrent_jobs` / `OverrideMaxConcurrentJobs` (Nullable<Int64>): Maximum number of concurrent jobs (default 500) 50 | * `graceful_shutdown_timeout` / `GracefulShutdownTimeout` (Nullable<Int64>): Graceful shutdown timeout in seconds (default 15) 51 | * `transfer_rate_limit` / `TransferRateLimit` (string): File transfer (upload/download) rate limit 52 | `<limit>-<period>`, with the given periods: 53 | * 'S': second 54 | * 'M': minute 55 | * 'H': hour 56 | * 'D': day 57 | Examples: 58 | * 5 requests/second: '5-S' 59 | * 10 requests/minute: '10-M' 60 | * 1000 requests/hour: '1000-H' 61 | * 2000 requests/day: '2000-D' 62 | * `auto_update_policy` / `AutoUpdatePolicy` (string): Auto update policy ['manual_trigger', 'critical_only', 'always', 'never'] (default critical_only) 63 | * `api_token` / `ApiToken` (string): Files Agent API Token 64 | * `port` / `Port` (Nullable<Int64>): Incoming port for files agent connections 65 | * `hostname` / `Hostname` (string): 66 | * `public_key` / `PublicKey` (string): public key 67 | * `status` / `Status` (string): either running or shutdown 68 | * `server_host_key` / `ServerHostKey` (string): 69 | * `config_version` / `ConfigVersion` (string): agent config version 70 | -------------------------------------------------------------------------------- /docs/UsageSnapshot.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UsageSnapshot 2 | 3 | ## Example UsageSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "start_at": "2000-01-01T01:00:00Z", 9 | "end_at": "2000-01-01T01:00:00Z", 10 | "high_water_user_count": 1, 11 | "current_storage": 1.0, 12 | "high_water_storage": 1.0, 13 | "root_storage": 1.0, 14 | "deleted_files_counted_in_minimum": 1.0, 15 | "deleted_files_storage": 1.0, 16 | "total_billable_usage": 1.0, 17 | "total_billable_transfer_usage": 1.0, 18 | "bytes_sent": 1.0, 19 | "sync_bytes_received": 1.0, 20 | "sync_bytes_sent": 1.0, 21 | "usage_by_top_level_dir": [ 22 | { 23 | "dir": "dir", 24 | "size": 100, 25 | "count": 10 26 | } 27 | ] 28 | } 29 | ``` 30 | 31 | * `id` / `Id` (Nullable<Int64>): Usage snapshot ID 32 | * `start_at` / `StartAt` (Nullable<DateTime>): Usage snapshot start date/time 33 | * `end_at` / `EndAt` (Nullable<DateTime>): Usage snapshot end date/time 34 | * `high_water_user_count` / `HighWaterUserCount` (Nullable<Int64>): Highest user count number in time period 35 | * `current_storage` / `CurrentStorage` (double): Current total Storage Usage GB as of end date (not necessarily high water mark, which is used for billing) 36 | * `high_water_storage` / `HighWaterStorage` (double): Highest Storage Usage GB recorded in time period (used for billing) 37 | * `root_storage` / `RootStorage` (double): Storage Usage for root folder as of end date (not necessarily high water mark, which is used for billing) 38 | * `deleted_files_counted_in_minimum` / `DeletedFilesCountedInMinimum` (double): Storage Usage for files that are deleted but uploaded within last 30 days as of end date (not necessarily high water mark, which is used for billing) 39 | * `deleted_files_storage` / `DeletedFilesStorage` (double): Storage Usage for files that are deleted but retained as backups as of end date (not necessarily high water mark, which is used for billing) 40 | * `total_billable_usage` / `TotalBillableUsage` (double): Storage + Transfer Usage - Total Billable amount 41 | * `total_billable_transfer_usage` / `TotalBillableTransferUsage` (double): Transfer usage for period - Total Billable amount 42 | * `bytes_sent` / `BytesSent` (double): Transfer Usage for period - Outbound GB from Files Native Storage 43 | * `sync_bytes_received` / `SyncBytesReceived` (double): Transfer Usage for period - Inbound GB to Remote Servers (Sync/Mount) 44 | * `sync_bytes_sent` / `SyncBytesSent` (double): Transfer Usage for period - Outbound GB from Remote Servers (Sync/Mount) 45 | * `usage_by_top_level_dir` / `UsageByTopLevelDir` (object[]): Storage Usage - map of root folders to their usage as of end date (not necessarily high water mark, which is used for billing) 46 | 47 | 48 | --- 49 | 50 | ## List Usage Snapshots 51 | 52 | ``` 53 | Task<FilesList<UsageSnapshot>> UsageSnapshot.List( 54 | 55 | Dictionary<string, object> parameters = null, 56 | Dictionary<string, object> options = null 57 | ) 58 | ``` 59 | 60 | ### Parameters 61 | 62 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 63 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 64 | -------------------------------------------------------------------------------- /docs/Lock.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Lock 2 | 3 | ## Example Lock Object 4 | 5 | ``` 6 | { 7 | "path": "locked_file", 8 | "timeout": 1, 9 | "depth": "infinity", 10 | "recursive": true, 11 | "owner": "user", 12 | "scope": "shared", 13 | "exclusive": true, 14 | "token": "17c54824e9931a4688ca032d03f6663c", 15 | "type": "write", 16 | "allow_access_by_any_user": true, 17 | "user_id": 1, 18 | "username": "" 19 | } 20 | ``` 21 | 22 | * `path` / `Path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 23 | * `timeout` / `Timeout` (Nullable<Int64>): Lock timeout in seconds 24 | * `depth` / `Depth` (string): 25 | * `recursive` / `Recursive` (bool): Does lock apply to subfolders? 26 | * `owner` / `Owner` (string): Owner of the lock. This can be any arbitrary string. 27 | * `scope` / `Scope` (string): 28 | * `exclusive` / `Exclusive` (bool): Is lock exclusive? 29 | * `token` / `Token` (string): Lock token. Use to release lock. 30 | * `type` / `Type` (string): 31 | * `allow_access_by_any_user` / `AllowAccessByAnyUser` (bool): Can lock be modified by users other than its creator? 32 | * `user_id` / `UserId` (Nullable<Int64>): Lock creator user ID 33 | * `username` / `Username` (string): Lock creator username 34 | 35 | 36 | --- 37 | 38 | ## List Locks by Path 39 | 40 | ``` 41 | Task<FilesList<Lock>> Lock.ListFor( 42 | string path, 43 | Dictionary<string, object> parameters = null, 44 | Dictionary<string, object> options = null 45 | ) 46 | ``` 47 | 48 | ### Parameters 49 | 50 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 51 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `path` (string): Required - Path to operate on. 53 | * `include_children` (bool): Include locks from children objects? 54 | 55 | 56 | --- 57 | 58 | ## Create Lock 59 | 60 | ``` 61 | Task<Lock> Lock.Create( 62 | string path, 63 | Dictionary<string, object> parameters = null, 64 | Dictionary<string, object> options = null 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `path` (string): Required - Path 71 | * `allow_access_by_any_user` (bool): Can lock be modified by users other than its creator? 72 | * `exclusive` (bool): Is lock exclusive? 73 | * `recursive` (bool): Does lock apply to subfolders? 74 | * `timeout` (Nullable<Int64>): Lock timeout in seconds 75 | 76 | 77 | --- 78 | 79 | ## Delete Lock 80 | 81 | ``` 82 | Task Lock.Delete( 83 | string path, 84 | Dictionary<string, object> parameters = null, 85 | Dictionary<string, object> options = null 86 | ) 87 | ``` 88 | 89 | ### Parameters 90 | 91 | * `path` (string): Required - Path 92 | * `token` (string): Required - Lock token 93 | 94 | 95 | --- 96 | 97 | ## Delete Lock 98 | 99 | ``` 100 | var Lock = Lock.ListFor(path)[0]; 101 | 102 | var parameters = new Dictionary<string, object>(); 103 | 104 | parameters.Add("token", "token"); 105 | 106 | Lock.Delete(parameters); 107 | ``` 108 | 109 | ### Parameters 110 | 111 | * `path` (string): Required - Path 112 | * `token` (string): Required - Lock token 113 | -------------------------------------------------------------------------------- /docs/AutomationRun.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.AutomationRun 2 | 3 | ## Example AutomationRun Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "automation_id": 1, 9 | "completed_at": "2000-01-01T01:00:00Z", 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "retry_at": "2000-01-01T01:00:00Z", 12 | "retried_at": "2000-01-01T01:00:00Z", 13 | "retried_in_run_id": 1, 14 | "retry_of_run_id": 1, 15 | "runtime": 1.0, 16 | "status": "success", 17 | "successful_operations": 1, 18 | "failed_operations": 1, 19 | "status_messages_url": "https://www.example.com/log_file.txt" 20 | } 21 | ``` 22 | 23 | * `id` / `Id` (Nullable<Int64>): ID. 24 | * `automation_id` / `AutomationId` (Nullable<Int64>): ID of the associated Automation. 25 | * `completed_at` / `CompletedAt` (Nullable<DateTime>): Automation run completion/failure date/time. 26 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Automation run start date/time. 27 | * `retry_at` / `RetryAt` (Nullable<DateTime>): If set, this automation will be retried at this date/time due to `failure` or `partial_failure`. 28 | * `retried_at` / `RetriedAt` (Nullable<DateTime>): If set, this Automation run was retried due to `failure` or `partial_failure`. 29 | * `retried_in_run_id` / `RetriedInRunId` (Nullable<Int64>): ID of the run that is or will be retrying this run. 30 | * `retry_of_run_id` / `RetryOfRunId` (Nullable<Int64>): ID of the original run that this run is retrying. 31 | * `runtime` / `Runtime` (double): Automation run runtime. 32 | * `status` / `Status` (string): The success status of the AutomationRun. One of `running`, `success`, `partial_failure`, or `failure`. 33 | * `successful_operations` / `SuccessfulOperations` (Nullable<Int64>): Count of successful operations. 34 | * `failed_operations` / `FailedOperations` (Nullable<Int64>): Count of failed operations. 35 | * `status_messages_url` / `StatusMessagesUrl` (string): Link to status messages log file. 36 | 37 | 38 | --- 39 | 40 | ## List Automation Runs 41 | 42 | ``` 43 | Task<FilesList<AutomationRun>> AutomationRun.List( 44 | 45 | Dictionary<string, object> parameters = null, 46 | Dictionary<string, object> options = null 47 | ) 48 | ``` 49 | 50 | ### Parameters 51 | 52 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 53 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 54 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 55 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`. 56 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `automation_id`. Valid field combinations are `[ automation_id, status ]`. 57 | * `automation_id` (Nullable<Int64>): Required - ID of the associated Automation. 58 | 59 | 60 | --- 61 | 62 | ## Show Automation Run 63 | 64 | ``` 65 | Task<AutomationRun> AutomationRun.Find( 66 | Nullable<Int64> id, 67 | Dictionary<string, object> parameters = null, 68 | Dictionary<string, object> options = null 69 | ) 70 | ``` 71 | 72 | ### Parameters 73 | 74 | * `id` (Nullable<Int64>): Required - Automation Run ID. 75 | -------------------------------------------------------------------------------- /docs/ActionNotificationExport.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.ActionNotificationExport 2 | 3 | ## Example ActionNotificationExport Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "export_version": "20201213.2", 9 | "start_at": "2000-01-01T01:00:00Z", 10 | "end_at": "2000-01-01T01:00:00Z", 11 | "status": "ready", 12 | "query_path": "MyFile.txt", 13 | "query_folder": "MyFolder", 14 | "query_message": "Connection Refused", 15 | "query_request_method": "GET", 16 | "query_request_url": "http://example.com/webhook", 17 | "query_status": "200", 18 | "query_success": true, 19 | "results_url": "https://files.com/action_notification_results.csv" 20 | } 21 | ``` 22 | 23 | * `id` / `Id` (Nullable<Int64>): History Export ID 24 | * `export_version` / `ExportVersion` (string): Version of the underlying records for the export. 25 | * `start_at` / `StartAt` (Nullable<DateTime>): Start date/time of export range. 26 | * `end_at` / `EndAt` (Nullable<DateTime>): End date/time of export range. 27 | * `status` / `Status` (string): Status of export. Valid values: `building`, `ready`, or `failed` 28 | * `query_path` / `QueryPath` (string): Return notifications that were triggered by actions on this specific path. 29 | * `query_folder` / `QueryFolder` (string): Return notifications that were triggered by actions in this folder. 30 | * `query_message` / `QueryMessage` (string): Error message associated with the request, if any. 31 | * `query_request_method` / `QueryRequestMethod` (string): The HTTP request method used by the webhook. 32 | * `query_request_url` / `QueryRequestUrl` (string): The target webhook URL. 33 | * `query_status` / `QueryStatus` (string): The HTTP status returned from the server in response to the webhook request. 34 | * `query_success` / `QuerySuccess` (bool): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 35 | * `results_url` / `ResultsUrl` (string): If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV. 36 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 37 | 38 | 39 | --- 40 | 41 | ## Show Action Notification Export 42 | 43 | ``` 44 | Task<ActionNotificationExport> ActionNotificationExport.Find( 45 | Nullable<Int64> id, 46 | Dictionary<string, object> parameters = null, 47 | Dictionary<string, object> options = null 48 | ) 49 | ``` 50 | 51 | ### Parameters 52 | 53 | * `id` (Nullable<Int64>): Required - Action Notification Export ID. 54 | 55 | 56 | --- 57 | 58 | ## Create Action Notification Export 59 | 60 | ``` 61 | Task<ActionNotificationExport> ActionNotificationExport.Create( 62 | 63 | Dictionary<string, object> parameters = null, 64 | Dictionary<string, object> options = null 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 71 | * `start_at` (string): Start date/time of export range. 72 | * `end_at` (string): End date/time of export range. 73 | * `query_message` (string): Error message associated with the request, if any. 74 | * `query_request_method` (string): The HTTP request method used by the webhook. 75 | * `query_request_url` (string): The target webhook URL. 76 | * `query_status` (string): The HTTP status returned from the server in response to the webhook request. 77 | * `query_success` (bool): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 78 | * `query_path` (string): Return notifications that were triggered by actions on this specific path. 79 | * `query_folder` (string): Return notifications that were triggered by actions in this folder. 80 | -------------------------------------------------------------------------------- /examples/files-cli/Commands/ShowUserCommand.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Models; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace files_cli.Commands 6 | { 7 | public class ShowUserCommand : BaseCommand 8 | { 9 | public int UserId { get; set; } 10 | 11 | public ShowUserCommand() 12 | { 13 | IsCommand("ShowUser", "Prints user info"); 14 | 15 | HasLongDescription("Shows a specific user's information."); 16 | 17 | HasRequiredOption("id=", "The id of the user to show.", id => UserId = int.Parse(id)); 18 | } 19 | 20 | public override async Task<int> RunAsync(string[] remainingArguments) 21 | { 22 | User user = await User.Get(UserId, null, await GetOptions()); 23 | 24 | Console.WriteLine($"Id: {user.Id}"); 25 | Console.WriteLine($"Username: {user.Username}"); 26 | Console.WriteLine($"AdminGroupIds: {user.AdminGroupIds}"); 27 | Console.WriteLine($"AllowedIps: {user.AllowedIps}"); 28 | Console.WriteLine($"AttachmentsPermission: {user.AttachmentsPermission}"); 29 | Console.WriteLine($"ApiKeysCount: {user.ApiKeysCount}"); 30 | Console.WriteLine($"AuthenticateUntil: {user.AuthenticateUntil}"); 31 | Console.WriteLine($"AuthenticationMethod: {user.AuthenticationMethod}"); 32 | Console.WriteLine($"AvatarUrl: {user.AvatarUrl}"); 33 | Console.WriteLine($"BillingPermission: {user.BillingPermission}"); 34 | Console.WriteLine($"BypassSiteAllowedIps: {user.BypassSiteAllowedIps}"); 35 | Console.WriteLine($"CreatedAt: {user.CreatedAt}"); 36 | Console.WriteLine($"DavPermission: {user.DavPermission}"); 37 | Console.WriteLine($"Disabled: {user.Disabled}"); 38 | Console.WriteLine($"LastLoginAt: {user.LastLoginAt}"); 39 | Console.WriteLine($"LastProtocolCipher: {user.LastProtocolCipher}"); 40 | Console.WriteLine($"LockoutExpires: {user.LockoutExpires}"); 41 | Console.WriteLine($"Name: {user.Name}"); 42 | Console.WriteLine($"Notes: {user.Notes}"); 43 | Console.WriteLine($"NotificationDailySendTime: {user.NotificationDailySendTime}"); 44 | Console.WriteLine($"PasswordSetAt: {user.PasswordSetAt}"); 45 | Console.WriteLine($"PasswordValidityDays: {user.PasswordValidityDays}"); 46 | Console.WriteLine($"PublicKeysCount: {user.PublicKeysCount}"); 47 | Console.WriteLine($"ReceiveAdminAlerts: {user.ReceiveAdminAlerts}"); 48 | Console.WriteLine($"Require2fa: {user.Require2fa}"); 49 | Console.WriteLine($"RequirePasswordChange: {user.RequirePasswordChange}"); 50 | Console.WriteLine($"RestapiPermission: {user.RestapiPermission}"); 51 | Console.WriteLine($"SelfManaged: {user.SelfManaged}"); 52 | Console.WriteLine($"SftpPermission: {user.SftpPermission}"); 53 | Console.WriteLine($"SiteAdmin: {user.SiteAdmin}"); 54 | Console.WriteLine($"SkipWelcomeScreen: {user.SkipWelcomeScreen}"); 55 | Console.WriteLine($"SslRequired: {user.SslRequired}"); 56 | Console.WriteLine($"SsoStrategyId: {user.SsoStrategyId}"); 57 | Console.WriteLine($"SubscribeToNewsletter: {user.SubscribeToNewsletter}"); 58 | Console.WriteLine($"ExternallyManaged: {user.ExternallyManaged}"); 59 | Console.WriteLine($"TimeZone: {user.TimeZone}"); 60 | Console.WriteLine($"TypeOf2fa: {user.TypeOf2fa}"); 61 | Console.WriteLine($"UserRoot: {user.UserRoot}"); 62 | return Success; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /docs/UsageDailySnapshot.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.UsageDailySnapshot 2 | 3 | ## Example UsageDailySnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "date": "2000-01-01T01:00:00Z", 9 | "api_usage_available": true, 10 | "read_api_usage": 1, 11 | "write_api_usage": 1, 12 | "user_count": 1, 13 | "current_storage": 1.0, 14 | "deleted_files_storage": 1.0, 15 | "deleted_files_counted_in_minimum": 1.0, 16 | "root_storage": 1.0, 17 | "usage_by_top_level_dir": [ 18 | { 19 | "dir": "dir", 20 | "size": 100, 21 | "count": 10 22 | } 23 | ] 24 | } 25 | ``` 26 | 27 | * `id` / `Id` (Nullable<Int64>): ID of the usage record 28 | * `date` / `Date` (Nullable<DateTime>): The date of this usage record 29 | * `api_usage_available` / `ApiUsageAvailable` (bool): True if the API usage fields `read_api_usage` and `write_api_usage` can be relied upon. If this is false, we suggest hiding that value from any UI. 30 | * `read_api_usage` / `ReadApiUsage` (Nullable<Int64>): Read API Calls used on this day. Note: only updated for days before the current day. 31 | * `write_api_usage` / `WriteApiUsage` (Nullable<Int64>): Write API Calls used on this day. Note: only updated for days before the current day. 32 | * `user_count` / `UserCount` (Nullable<Int64>): Number of billable users as of this day. 33 | * `current_storage` / `CurrentStorage` (double): GB of Files Native Storage used on this day. 34 | * `deleted_files_storage` / `DeletedFilesStorage` (double): GB of Files Native Storage used on this day for files that have been deleted and are stored as backups. 35 | * `deleted_files_counted_in_minimum` / `DeletedFilesCountedInMinimum` (double): GB of Files Native Storage used on this day for files that have been permanently deleted but were uploaded less than 30 days ago, and are still billable. 36 | * `root_storage` / `RootStorage` (double): GB of Files Native Storage used for the root folder. Included here because this value will not be part of `usage_by_top_level_dir` 37 | * `usage_by_top_level_dir` / `UsageByTopLevelDir` (object[]): Usage broken down by each top-level folder 38 | 39 | 40 | --- 41 | 42 | ## List Usage Daily Snapshots 43 | 44 | ``` 45 | Task<FilesList<UsageDailySnapshot>> UsageDailySnapshot.List( 46 | 47 | Dictionary<string, object> parameters = null, 48 | Dictionary<string, object> options = null 49 | ) 50 | ``` 51 | 52 | ### Parameters 53 | 54 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 55 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 56 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `date`. 57 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`. 58 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `date`. 59 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `date`. 60 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `date`. 61 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `date`. 62 | -------------------------------------------------------------------------------- /docs/IpAddress.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.IpAddress 2 | 3 | ## Example IpAddress Object 4 | 5 | ``` 6 | { 7 | "id": "Site", 8 | "associated_with": "Site", 9 | "group_id": 1, 10 | "ip_addresses": [ 11 | "127.0.0.1" 12 | ] 13 | } 14 | ``` 15 | 16 | * `id` / `Id` (string): Unique label for list; used by Zapier and other integrations. 17 | * `associated_with` / `AssociatedWith` (string): The object that this public IP address list is associated with. 18 | * `group_id` / `GroupId` (Nullable<Int64>): Group ID 19 | * `ip_addresses` / `IpAddresses` (string[]): A list of IP addresses. 20 | 21 | 22 | --- 23 | 24 | ## List IP Addresses associated with the current site 25 | 26 | ``` 27 | Task<FilesList<IpAddress>> IpAddress.List( 28 | 29 | Dictionary<string, object> parameters = null, 30 | Dictionary<string, object> options = null 31 | ) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 37 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 38 | 39 | 40 | --- 41 | 42 | ## List all possible public SmartFile IP addresses 43 | 44 | ``` 45 | Task<FilesList<PublicIpAddress>> IpAddress.GetSmartfileReserved( 46 | 47 | Dictionary<string, object> parameters = null, 48 | Dictionary<string, object> options = null 49 | ) 50 | ``` 51 | 52 | ### Parameters 53 | 54 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 55 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 56 | 57 | 58 | --- 59 | 60 | ## List all possible public ExaVault IP addresses 61 | 62 | ``` 63 | Task<FilesList<PublicIpAddress>> IpAddress.GetExavaultReserved( 64 | 65 | Dictionary<string, object> parameters = null, 66 | Dictionary<string, object> options = null 67 | ) 68 | ``` 69 | 70 | ### Parameters 71 | 72 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 73 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 74 | 75 | 76 | --- 77 | 78 | ## List all possible public IP addresses 79 | 80 | ``` 81 | Task<FilesList<PublicIpAddress>> IpAddress.GetReserved( 82 | 83 | Dictionary<string, object> parameters = null, 84 | Dictionary<string, object> options = null 85 | ) 86 | ``` 87 | 88 | ### Parameters 89 | 90 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 91 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 92 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/PaymentLineItem.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class PaymentLineItem 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public PaymentLineItem() : this(null, null) { } 16 | 17 | public PaymentLineItem(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("amount")) 33 | { 34 | this.attributes.Add("amount", null); 35 | } 36 | if (!this.attributes.ContainsKey("created_at")) 37 | { 38 | this.attributes.Add("created_at", null); 39 | } 40 | if (!this.attributes.ContainsKey("invoice_id")) 41 | { 42 | this.attributes.Add("invoice_id", null); 43 | } 44 | if (!this.attributes.ContainsKey("payment_id")) 45 | { 46 | this.attributes.Add("payment_id", null); 47 | } 48 | } 49 | 50 | public Dictionary<string, object> getAttributes() 51 | { 52 | return new Dictionary<string, object>(this.attributes); 53 | } 54 | 55 | public object GetOption(string name) 56 | { 57 | return (this.options.ContainsKey(name) ? this.options[name] : null); 58 | } 59 | 60 | public void SetOption(string name, object value) 61 | { 62 | this.options[name] = value; 63 | } 64 | 65 | 66 | /// <summary> 67 | /// Payment line item amount 68 | /// </summary> 69 | [JsonInclude] 70 | [JsonPropertyName("amount")] 71 | public double Amount 72 | { 73 | get { return (double)attributes["amount"]; } 74 | private set { attributes["amount"] = value; } 75 | } 76 | 77 | /// <summary> 78 | /// Payment line item created at date/time 79 | /// </summary> 80 | [JsonInclude] 81 | [JsonPropertyName("created_at")] 82 | public Nullable<DateTime> CreatedAt 83 | { 84 | get { return (Nullable<DateTime>)attributes["created_at"]; } 85 | private set { attributes["created_at"] = value; } 86 | } 87 | 88 | /// <summary> 89 | /// Invoice ID 90 | /// </summary> 91 | [JsonInclude] 92 | [JsonPropertyName("invoice_id")] 93 | public Nullable<Int64> InvoiceId 94 | { 95 | get { return (Nullable<Int64>)attributes["invoice_id"]; } 96 | private set { attributes["invoice_id"] = value; } 97 | } 98 | 99 | /// <summary> 100 | /// Payment ID 101 | /// </summary> 102 | [JsonInclude] 103 | [JsonPropertyName("payment_id")] 104 | public Nullable<Int64> PaymentId 105 | { 106 | get { return (Nullable<Int64>)attributes["payment_id"]; } 107 | private set { attributes["payment_id"] = value; } 108 | } 109 | 110 | 111 | 112 | } 113 | } -------------------------------------------------------------------------------- /docs/SftpHostKey.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.SftpHostKey 2 | 3 | ## Example SftpHostKey Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "My Key", 9 | "fingerprint_md5": "12:7e:f8:61:78:a4:b2:c2:ee:12:51:92:25:a7:42:cc", 10 | "fingerprint_sha256": "SHA256:5ANRkDpXWA+PgOquzZAG9RtQ1Bt8KXYAH2hecr7LQk8" 11 | } 12 | ``` 13 | 14 | * `id` / `Id` (Nullable<Int64>): SFTP Host Key ID 15 | * `name` / `Name` (string): The friendly name of this SFTP Host Key. 16 | * `fingerprint_md5` / `FingerprintMd5` (string): MD5 Fingerprint of the public key 17 | * `fingerprint_sha256` / `FingerprintSha256` (string): SHA256 Fingerprint of the public key 18 | * `private_key` / `PrivateKey` (string): The private key data. 19 | 20 | 21 | --- 22 | 23 | ## List SFTP Host Keys 24 | 25 | ``` 26 | Task<FilesList<SftpHostKey>> SftpHostKey.List( 27 | 28 | Dictionary<string, object> parameters = null, 29 | Dictionary<string, object> options = null 30 | ) 31 | ``` 32 | 33 | ### Parameters 34 | 35 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 36 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 37 | 38 | 39 | --- 40 | 41 | ## Show SFTP Host Key 42 | 43 | ``` 44 | Task<SftpHostKey> SftpHostKey.Find( 45 | Nullable<Int64> id, 46 | Dictionary<string, object> parameters = null, 47 | Dictionary<string, object> options = null 48 | ) 49 | ``` 50 | 51 | ### Parameters 52 | 53 | * `id` (Nullable<Int64>): Required - Sftp Host Key ID. 54 | 55 | 56 | --- 57 | 58 | ## Create SFTP Host Key 59 | 60 | ``` 61 | Task<SftpHostKey> SftpHostKey.Create( 62 | 63 | Dictionary<string, object> parameters = null, 64 | Dictionary<string, object> options = null 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `name` (string): The friendly name of this SFTP Host Key. 71 | * `private_key` (string): The private key data. 72 | 73 | 74 | --- 75 | 76 | ## Update SFTP Host Key 77 | 78 | ``` 79 | Task<SftpHostKey> SftpHostKey.Update( 80 | Nullable<Int64> id, 81 | Dictionary<string, object> parameters = null, 82 | Dictionary<string, object> options = null 83 | ) 84 | ``` 85 | 86 | ### Parameters 87 | 88 | * `id` (Nullable<Int64>): Required - Sftp Host Key ID. 89 | * `name` (string): The friendly name of this SFTP Host Key. 90 | * `private_key` (string): The private key data. 91 | 92 | 93 | --- 94 | 95 | ## Delete SFTP Host Key 96 | 97 | ``` 98 | Task SftpHostKey.Delete( 99 | Nullable<Int64> id, 100 | Dictionary<string, object> parameters = null, 101 | Dictionary<string, object> options = null 102 | ) 103 | ``` 104 | 105 | ### Parameters 106 | 107 | * `id` (Nullable<Int64>): Required - Sftp Host Key ID. 108 | 109 | 110 | --- 111 | 112 | ## Update SFTP Host Key 113 | 114 | ``` 115 | var SftpHostKey = SftpHostKey.Find(1); 116 | 117 | var parameters = new Dictionary<string, object>(); 118 | 119 | parameters.Add("name", "My Key"); 120 | 121 | SftpHostKey.Update(parameters); 122 | ``` 123 | 124 | ### Parameters 125 | 126 | * `id` (Nullable<Int64>): Required - Sftp Host Key ID. 127 | * `name` (string): The friendly name of this SFTP Host Key. 128 | * `private_key` (string): The private key data. 129 | 130 | 131 | --- 132 | 133 | ## Delete SFTP Host Key 134 | 135 | ``` 136 | var SftpHostKey = SftpHostKey.Find(1); 137 | 138 | var parameters = new Dictionary<string, object>(); 139 | 140 | 141 | SftpHostKey.Delete 142 | ``` 143 | 144 | ### Parameters 145 | 146 | * `id` (Nullable<Int64>): Required - Sftp Host Key ID. 147 | -------------------------------------------------------------------------------- /docs/BundleAction.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.BundleAction 2 | 3 | ## Example BundleAction Object 4 | 5 | ``` 6 | { 7 | "action": "create", 8 | "bundle_registration": { 9 | "code": "abc123", 10 | "name": "account", 11 | "company": "Action Verb", 12 | "email": "john.doe@files.com", 13 | "ip": "10.1.1.1", 14 | "inbox_code": "abc123", 15 | "clickwrap_body": "example", 16 | "form_field_set_id": 1, 17 | "form_field_data": { 18 | "key": "example value" 19 | }, 20 | "bundle_code": "example", 21 | "bundle_id": 1, 22 | "bundle_recipient_id": 1, 23 | "created_at": "2000-01-01T01:00:00Z" 24 | }, 25 | "created_at": "2000-01-01T01:00:00Z", 26 | "destination": "/to_path", 27 | "path": "", 28 | "source": "/from_path", 29 | "bundle_registration_id": 1, 30 | "bundle_registration_name": "John Doe", 31 | "bundle_registration_email": "john@example.com", 32 | "bundle_registration_ip": "127.0.0.1" 33 | } 34 | ``` 35 | 36 | * `action` / `Action` (string): Type of action 37 | * `bundle_registration` / `BundleRegistration` (BundleRegistration): Object that contains bundle registration information 38 | * `created_at` / `CreatedAt` (Nullable<DateTime>): Action occurrence date/time 39 | * `destination` / `Destination` (string): The destination path for this bundle action, if applicable 40 | * `path` / `Path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 41 | * `source` / `Source` (string): The source path for this bundle action, if applicable 42 | * `bundle_registration_id` / `BundleRegistrationId` (Nullable<Int64>): Identifier of the associated bundle registration 43 | * `bundle_registration_name` / `BundleRegistrationName` (string): Name of the registrant who performed the action 44 | * `bundle_registration_email` / `BundleRegistrationEmail` (string): Email of the registrant 45 | * `bundle_registration_ip` / `BundleRegistrationIp` (string): IP address of the registrant 46 | 47 | 48 | --- 49 | 50 | ## List Bundle Actions 51 | 52 | ``` 53 | Task<FilesList<BundleAction>> BundleAction.List( 54 | 55 | Dictionary<string, object> parameters = null, 56 | Dictionary<string, object> options = null 57 | ) 58 | ``` 59 | 60 | ### Parameters 61 | 62 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 63 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 64 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 65 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `bundle_registration_id`. 66 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`. 67 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 68 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 69 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 70 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 71 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/PublicIpAddress.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class PublicIpAddress 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public PublicIpAddress() : this(null, null) { } 16 | 17 | public PublicIpAddress(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("ip_address")) 33 | { 34 | this.attributes.Add("ip_address", null); 35 | } 36 | if (!this.attributes.ContainsKey("server_name")) 37 | { 38 | this.attributes.Add("server_name", null); 39 | } 40 | if (!this.attributes.ContainsKey("ftp_enabled")) 41 | { 42 | this.attributes.Add("ftp_enabled", false); 43 | } 44 | if (!this.attributes.ContainsKey("sftp_enabled")) 45 | { 46 | this.attributes.Add("sftp_enabled", false); 47 | } 48 | } 49 | 50 | public Dictionary<string, object> getAttributes() 51 | { 52 | return new Dictionary<string, object>(this.attributes); 53 | } 54 | 55 | public object GetOption(string name) 56 | { 57 | return (this.options.ContainsKey(name) ? this.options[name] : null); 58 | } 59 | 60 | public void SetOption(string name, object value) 61 | { 62 | this.options[name] = value; 63 | } 64 | 65 | 66 | /// <summary> 67 | /// The public IP address. 68 | /// </summary> 69 | [JsonInclude] 70 | [JsonPropertyName("ip_address")] 71 | public string IpAddress 72 | { 73 | get { return (string)attributes["ip_address"]; } 74 | private set { attributes["ip_address"] = value; } 75 | } 76 | 77 | /// <summary> 78 | /// The name of the frontend server. 79 | /// </summary> 80 | [JsonInclude] 81 | [JsonPropertyName("server_name")] 82 | public string ServerName 83 | { 84 | get { return (string)attributes["server_name"]; } 85 | private set { attributes["server_name"] = value; } 86 | } 87 | 88 | /// <summary> 89 | /// </summary> 90 | [JsonInclude] 91 | [JsonConverter(typeof(BooleanJsonConverter))] 92 | [JsonPropertyName("ftp_enabled")] 93 | public bool FtpEnabled 94 | { 95 | get { return attributes["ftp_enabled"] == null ? false : (bool)attributes["ftp_enabled"]; } 96 | private set { attributes["ftp_enabled"] = value; } 97 | } 98 | 99 | /// <summary> 100 | /// </summary> 101 | [JsonInclude] 102 | [JsonConverter(typeof(BooleanJsonConverter))] 103 | [JsonPropertyName("sftp_enabled")] 104 | public bool SftpEnabled 105 | { 106 | get { return attributes["sftp_enabled"] == null ? false : (bool)attributes["sftp_enabled"]; } 107 | private set { attributes["sftp_enabled"] = value; } 108 | } 109 | 110 | 111 | 112 | } 113 | } -------------------------------------------------------------------------------- /docs/App.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.App 2 | 3 | ## Example App Object 4 | 5 | ``` 6 | { 7 | "app_type": "example", 8 | "documentation_links": { 9 | "Important Info": "http://files.test/learn-more" 10 | }, 11 | "extended_description": "example", 12 | "extended_description_for_marketing_site": "example", 13 | "external_homepage_url": "example", 14 | "featured": true, 15 | "folder_behavior_type": "example", 16 | "icon_url": "example", 17 | "logo_thumbnail_url": "example", 18 | "logo_url": "example", 19 | "marketing_intro": "example", 20 | "marketing_youtube_url": "example", 21 | "name": "example", 22 | "package_manager_install_command": "example", 23 | "remote_server_type": "example", 24 | "screenshot_list_urls": [ 25 | "example" 26 | ], 27 | "sdk_installation_instructions_link": "example", 28 | "short_description": "example", 29 | "sso_strategy_type": "example", 30 | "siem_type": "example", 31 | "tutorial_youtube_url": "example" 32 | } 33 | ``` 34 | 35 | * `app_type` / `AppType` (string): The type of the App 36 | * `documentation_links` / `DocumentationLinks` (object): Collection of named links to documentation 37 | * `extended_description` / `ExtendedDescription` (string): Long description for the in-App landing page 38 | * `extended_description_for_marketing_site` / `ExtendedDescriptionForMarketingSite` (string): Long form description of the App 39 | * `external_homepage_url` / `ExternalHomepageUrl` (string): Link to external homepage 40 | * `featured` / `Featured` (bool): Is featured on the App listing? 41 | * `folder_behavior_type` / `FolderBehaviorType` (string): Associated Folder Behavior type, if any 42 | * `icon_url` / `IconUrl` (string): App icon 43 | * `logo_thumbnail_url` / `LogoThumbnailUrl` (string): Logo thumbnail for the App 44 | * `logo_url` / `LogoUrl` (string): Full size logo for the App 45 | * `marketing_intro` / `MarketingIntro` (string): Marketing introdution of the App 46 | * `marketing_youtube_url` / `MarketingYoutubeUrl` (string): Marketing video page 47 | * `name` / `Name` (string): Name of the App 48 | * `package_manager_install_command` / `PackageManagerInstallCommand` (string): Package manager install command 49 | * `remote_server_type` / `RemoteServerType` (string): Associated Remote Server type, if any 50 | * `screenshot_list_urls` / `ScreenshotListUrls` (string[]): Screenshots of the App 51 | * `sdk_installation_instructions_link` / `SdkInstallationInstructionsLink` (string): Link to SDK installation instructions 52 | * `short_description` / `ShortDescription` (string): Short description of the App 53 | * `sso_strategy_type` / `SsoStrategyType` (string): Associated SSO Strategy type, if any 54 | * `siem_type` / `SiemType` (string): Associated SIEM type, if any 55 | * `tutorial_youtube_url` / `TutorialYoutubeUrl` (string): Tutorial video page 56 | 57 | 58 | --- 59 | 60 | ## List Apps 61 | 62 | ``` 63 | Task<FilesList<App>> App.List( 64 | 65 | Dictionary<string, object> parameters = null, 66 | Dictionary<string, object> options = null 67 | ) 68 | ``` 69 | 70 | ### Parameters 71 | 72 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 73 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 74 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name` and `app_type`. 75 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `name` and `app_type`. Valid field combinations are `[ name, app_type ]`. 76 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`. 77 | -------------------------------------------------------------------------------- /docs/MessageComment.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.MessageComment 2 | 3 | ## Example MessageComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great idea, thank you!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` / `Id` (Nullable<Int64>): Message Comment ID 19 | * `body` / `Body` (string): Comment body. 20 | * `reactions` / `Reactions` (object[]): Reactions to this comment. 21 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 22 | 23 | 24 | --- 25 | 26 | ## List Message Comments 27 | 28 | ``` 29 | Task<FilesList<MessageComment>> MessageComment.List( 30 | 31 | Dictionary<string, object> parameters = null, 32 | Dictionary<string, object> options = null 33 | ) 34 | ``` 35 | 36 | ### Parameters 37 | 38 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 39 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 40 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 42 | * `message_id` (Nullable<Int64>): Required - Message comment to return comments for. 43 | 44 | 45 | --- 46 | 47 | ## Show Message Comment 48 | 49 | ``` 50 | Task<MessageComment> MessageComment.Find( 51 | Nullable<Int64> id, 52 | Dictionary<string, object> parameters = null, 53 | Dictionary<string, object> options = null 54 | ) 55 | ``` 56 | 57 | ### Parameters 58 | 59 | * `id` (Nullable<Int64>): Required - Message Comment ID. 60 | 61 | 62 | --- 63 | 64 | ## Create Message Comment 65 | 66 | ``` 67 | Task<MessageComment> MessageComment.Create( 68 | 69 | Dictionary<string, object> parameters = null, 70 | Dictionary<string, object> options = null 71 | ) 72 | ``` 73 | 74 | ### Parameters 75 | 76 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 77 | * `body` (string): Required - Comment body. 78 | 79 | 80 | --- 81 | 82 | ## Update Message Comment 83 | 84 | ``` 85 | Task<MessageComment> MessageComment.Update( 86 | Nullable<Int64> id, 87 | Dictionary<string, object> parameters = null, 88 | Dictionary<string, object> options = null 89 | ) 90 | ``` 91 | 92 | ### Parameters 93 | 94 | * `id` (Nullable<Int64>): Required - Message Comment ID. 95 | * `body` (string): Required - Comment body. 96 | 97 | 98 | --- 99 | 100 | ## Delete Message Comment 101 | 102 | ``` 103 | Task MessageComment.Delete( 104 | Nullable<Int64> id, 105 | Dictionary<string, object> parameters = null, 106 | Dictionary<string, object> options = null 107 | ) 108 | ``` 109 | 110 | ### Parameters 111 | 112 | * `id` (Nullable<Int64>): Required - Message Comment ID. 113 | 114 | 115 | --- 116 | 117 | ## Update Message Comment 118 | 119 | ``` 120 | var MessageComment = MessageComment.Find(1); 121 | 122 | var parameters = new Dictionary<string, object>(); 123 | 124 | parameters.Add("body", "body"); 125 | 126 | MessageComment.Update(parameters); 127 | ``` 128 | 129 | ### Parameters 130 | 131 | * `id` (Nullable<Int64>): Required - Message Comment ID. 132 | * `body` (string): Required - Comment body. 133 | 134 | 135 | --- 136 | 137 | ## Delete Message Comment 138 | 139 | ``` 140 | var MessageComment = MessageComment.Find(1); 141 | 142 | var parameters = new Dictionary<string, object>(); 143 | 144 | 145 | MessageComment.Delete 146 | ``` 147 | 148 | ### Parameters 149 | 150 | * `id` (Nullable<Int64>): Required - Message Comment ID. 151 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/Preview.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class Preview 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public Preview() : this(null, null) { } 16 | 17 | public Preview(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("id")) 33 | { 34 | this.attributes.Add("id", null); 35 | } 36 | if (!this.attributes.ContainsKey("status")) 37 | { 38 | this.attributes.Add("status", null); 39 | } 40 | if (!this.attributes.ContainsKey("download_uri")) 41 | { 42 | this.attributes.Add("download_uri", null); 43 | } 44 | if (!this.attributes.ContainsKey("type")) 45 | { 46 | this.attributes.Add("type", null); 47 | } 48 | if (!this.attributes.ContainsKey("size")) 49 | { 50 | this.attributes.Add("size", null); 51 | } 52 | } 53 | 54 | public Dictionary<string, object> getAttributes() 55 | { 56 | return new Dictionary<string, object>(this.attributes); 57 | } 58 | 59 | public object GetOption(string name) 60 | { 61 | return (this.options.ContainsKey(name) ? this.options[name] : null); 62 | } 63 | 64 | public void SetOption(string name, object value) 65 | { 66 | this.options[name] = value; 67 | } 68 | 69 | 70 | /// <summary> 71 | /// Preview ID 72 | /// </summary> 73 | [JsonInclude] 74 | [JsonPropertyName("id")] 75 | public Nullable<Int64> Id 76 | { 77 | get { return (Nullable<Int64>)attributes["id"]; } 78 | private set { attributes["id"] = value; } 79 | } 80 | 81 | /// <summary> 82 | /// Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 83 | /// </summary> 84 | [JsonInclude] 85 | [JsonPropertyName("status")] 86 | public string Status 87 | { 88 | get { return (string)attributes["status"]; } 89 | private set { attributes["status"] = value; } 90 | } 91 | 92 | /// <summary> 93 | /// Link to download preview 94 | /// </summary> 95 | [JsonInclude] 96 | [JsonPropertyName("download_uri")] 97 | public string DownloadUri 98 | { 99 | get { return (string)attributes["download_uri"]; } 100 | private set { attributes["download_uri"] = value; } 101 | } 102 | 103 | /// <summary> 104 | /// Preview type. Can be image, pdf, pdf_native, video, or audio 105 | /// </summary> 106 | [JsonInclude] 107 | [JsonPropertyName("type")] 108 | public string Type 109 | { 110 | get { return (string)attributes["type"]; } 111 | private set { attributes["type"] = value; } 112 | } 113 | 114 | /// <summary> 115 | /// Preview size 116 | /// </summary> 117 | [JsonInclude] 118 | [JsonPropertyName("size")] 119 | public string Size 120 | { 121 | get { return (string)attributes["size"]; } 122 | private set { attributes["size"] = value; } 123 | } 124 | 125 | 126 | 127 | } 128 | } -------------------------------------------------------------------------------- /docs/GroupUser.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.GroupUser 2 | 3 | ## Example GroupUser Object 4 | 5 | ``` 6 | { 7 | "group_name": "My Group", 8 | "group_id": 1, 9 | "user_id": 1, 10 | "admin": true, 11 | "usernames": "user" 12 | } 13 | ``` 14 | 15 | * `group_name` / `GroupName` (string): Group name 16 | * `group_id` / `GroupId` (Nullable<Int64>): Group ID 17 | * `user_id` / `UserId` (Nullable<Int64>): User ID 18 | * `admin` / `Admin` (bool): Is this user an administrator of this group? 19 | * `usernames` / `Usernames` (string): Comma-delimited list of usernames who belong to this group (separated by commas). 20 | * `id` / `Id` (Nullable<Int64>): Group User ID. 21 | 22 | 23 | --- 24 | 25 | ## List Group Users 26 | 27 | ``` 28 | Task<FilesList<GroupUser>> GroupUser.List( 29 | 30 | Dictionary<string, object> parameters = null, 31 | Dictionary<string, object> options = null 32 | ) 33 | ``` 34 | 35 | ### Parameters 36 | 37 | * `user_id` (Nullable<Int64>): User ID. If provided, will return group_users of this user. 38 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 39 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `group_id` (Nullable<Int64>): Group ID. If provided, will return group_users of this group. 41 | 42 | 43 | --- 44 | 45 | ## Create Group User 46 | 47 | ``` 48 | Task<GroupUser> GroupUser.Create( 49 | 50 | Dictionary<string, object> parameters = null, 51 | Dictionary<string, object> options = null 52 | ) 53 | ``` 54 | 55 | ### Parameters 56 | 57 | * `group_id` (Nullable<Int64>): Required - Group ID to add user to. 58 | * `user_id` (Nullable<Int64>): Required - User ID to add to group. 59 | * `admin` (bool): Is the user a group administrator? 60 | 61 | 62 | --- 63 | 64 | ## Update Group User 65 | 66 | ``` 67 | Task<GroupUser> GroupUser.Update( 68 | Nullable<Int64> id, 69 | Dictionary<string, object> parameters = null, 70 | Dictionary<string, object> options = null 71 | ) 72 | ``` 73 | 74 | ### Parameters 75 | 76 | * `id` (Nullable<Int64>): Required - Group User ID. 77 | * `group_id` (Nullable<Int64>): Required - Group ID to add user to. 78 | * `user_id` (Nullable<Int64>): Required - User ID to add to group. 79 | * `admin` (bool): Is the user a group administrator? 80 | 81 | 82 | --- 83 | 84 | ## Delete Group User 85 | 86 | ``` 87 | Task GroupUser.Delete( 88 | Nullable<Int64> id, 89 | Dictionary<string, object> parameters = null, 90 | Dictionary<string, object> options = null 91 | ) 92 | ``` 93 | 94 | ### Parameters 95 | 96 | * `id` (Nullable<Int64>): Required - Group User ID. 97 | * `group_id` (Nullable<Int64>): Required - Group ID from which to remove user. 98 | * `user_id` (Nullable<Int64>): Required - User ID to remove from group. 99 | 100 | 101 | --- 102 | 103 | ## Update Group User 104 | 105 | ``` 106 | var GroupUser = GroupUser.ListFor(path)[0]; 107 | 108 | var parameters = new Dictionary<string, object>(); 109 | 110 | parameters.Add("group_id", 1); 111 | parameters.Add("user_id", 1); 112 | parameters.Add("admin", false); 113 | 114 | GroupUser.Update(parameters); 115 | ``` 116 | 117 | ### Parameters 118 | 119 | * `id` (Nullable<Int64>): Required - Group User ID. 120 | * `group_id` (Nullable<Int64>): Required - Group ID to add user to. 121 | * `user_id` (Nullable<Int64>): Required - User ID to add to group. 122 | * `admin` (bool): Is the user a group administrator? 123 | 124 | 125 | --- 126 | 127 | ## Delete Group User 128 | 129 | ``` 130 | var GroupUser = GroupUser.ListFor(path)[0]; 131 | 132 | var parameters = new Dictionary<string, object>(); 133 | 134 | parameters.Add("group_id", 1); 135 | parameters.Add("user_id", 1); 136 | 137 | GroupUser.Delete(parameters); 138 | ``` 139 | 140 | ### Parameters 141 | 142 | * `id` (Nullable<Int64>): Required - Group User ID. 143 | * `group_id` (Nullable<Int64>): Required - Group ID from which to remove user. 144 | * `user_id` (Nullable<Int64>): Required - User ID to remove from group. 145 | -------------------------------------------------------------------------------- /sdk/FilesCom/Models/HolidayRegion.cs: -------------------------------------------------------------------------------- 1 | using FilesCom.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Text.Json; 6 | using System.Text.Json.Serialization; 7 | using System.Threading.Tasks; 8 | 9 | namespace FilesCom.Models 10 | { 11 | public class HolidayRegion 12 | { 13 | private Dictionary<string, object> attributes; 14 | private Dictionary<string, object> options; 15 | public HolidayRegion() : this(null, null) { } 16 | 17 | public HolidayRegion(Dictionary<string, object> attributes, Dictionary<string, object> options) 18 | { 19 | this.attributes = attributes; 20 | this.options = options; 21 | 22 | if (this.attributes == null) 23 | { 24 | this.attributes = new Dictionary<string, object>(); 25 | } 26 | 27 | if (this.options == null) 28 | { 29 | this.options = new Dictionary<string, object>(); 30 | } 31 | 32 | if (!this.attributes.ContainsKey("code")) 33 | { 34 | this.attributes.Add("code", null); 35 | } 36 | if (!this.attributes.ContainsKey("name")) 37 | { 38 | this.attributes.Add("name", null); 39 | } 40 | } 41 | 42 | public Dictionary<string, object> getAttributes() 43 | { 44 | return new Dictionary<string, object>(this.attributes); 45 | } 46 | 47 | public object GetOption(string name) 48 | { 49 | return (this.options.ContainsKey(name) ? this.options[name] : null); 50 | } 51 | 52 | public void SetOption(string name, object value) 53 | { 54 | this.options[name] = value; 55 | } 56 | 57 | 58 | /// <summary> 59 | /// The code representing a region 60 | /// </summary> 61 | [JsonInclude] 62 | [JsonPropertyName("code")] 63 | public string Code 64 | { 65 | get { return (string)attributes["code"]; } 66 | private set { attributes["code"] = value; } 67 | } 68 | 69 | /// <summary> 70 | /// The name of the region 71 | /// </summary> 72 | [JsonInclude] 73 | [JsonPropertyName("name")] 74 | public string Name 75 | { 76 | get { return (string)attributes["name"]; } 77 | private set { attributes["name"] = value; } 78 | } 79 | 80 | 81 | 82 | /// <summary> 83 | /// Parameters: 84 | /// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 85 | /// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 86 | /// </summary> 87 | public static FilesList<HolidayRegion> GetSupported( 88 | 89 | Dictionary<string, object> parameters = null, 90 | Dictionary<string, object> options = null 91 | ) 92 | { 93 | parameters = parameters != null ? parameters : new Dictionary<string, object>(); 94 | options = options != null ? options : new Dictionary<string, object>(); 95 | 96 | if (parameters.ContainsKey("cursor") && !(parameters["cursor"] is string)) 97 | { 98 | throw new ArgumentException("Bad parameter: cursor must be of type string", "parameters[\"cursor\"]"); 99 | } 100 | if (parameters.ContainsKey("per_page") && !(parameters["per_page"] is Nullable<Int64>)) 101 | { 102 | throw new ArgumentException("Bad parameter: per_page must be of type Nullable<Int64>", "parameters[\"per_page\"]"); 103 | } 104 | 105 | return new FilesList<HolidayRegion>($"/holiday_regions/supported", System.Net.Http.HttpMethod.Get, parameters, options); 106 | } 107 | 108 | 109 | } 110 | } -------------------------------------------------------------------------------- /docs/KeyLifecycleRule.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.KeyLifecycleRule 2 | 3 | ## Example KeyLifecycleRule Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "key_type": "gpg", 9 | "inactivity_days": 12, 10 | "name": "inactive gpg keys" 11 | } 12 | ``` 13 | 14 | * `id` / `Id` (Nullable<Int64>): Key Lifecycle Rule ID 15 | * `key_type` / `KeyType` (string): Key type for which the rule will apply (gpg or ssh). 16 | * `inactivity_days` / `InactivityDays` (Nullable<Int64>): Number of days of inactivity before the rule applies. 17 | * `name` / `Name` (string): Key Lifecycle Rule name 18 | 19 | 20 | --- 21 | 22 | ## List Key Lifecycle Rules 23 | 24 | ``` 25 | Task<FilesList<KeyLifecycleRule>> KeyLifecycleRule.List( 26 | 27 | Dictionary<string, object> parameters = null, 28 | Dictionary<string, object> options = null 29 | ) 30 | ``` 31 | 32 | ### Parameters 33 | 34 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 35 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 36 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 37 | 38 | 39 | --- 40 | 41 | ## Show Key Lifecycle Rule 42 | 43 | ``` 44 | Task<KeyLifecycleRule> KeyLifecycleRule.Find( 45 | Nullable<Int64> id, 46 | Dictionary<string, object> parameters = null, 47 | Dictionary<string, object> options = null 48 | ) 49 | ``` 50 | 51 | ### Parameters 52 | 53 | * `id` (Nullable<Int64>): Required - Key Lifecycle Rule ID. 54 | 55 | 56 | --- 57 | 58 | ## Create Key Lifecycle Rule 59 | 60 | ``` 61 | Task<KeyLifecycleRule> KeyLifecycleRule.Create( 62 | 63 | Dictionary<string, object> parameters = null, 64 | Dictionary<string, object> options = null 65 | ) 66 | ``` 67 | 68 | ### Parameters 69 | 70 | * `key_type` (string): Key type for which the rule will apply (gpg or ssh). 71 | * `inactivity_days` (Nullable<Int64>): Number of days of inactivity before the rule applies. 72 | * `name` (string): Key Lifecycle Rule name 73 | 74 | 75 | --- 76 | 77 | ## Update Key Lifecycle Rule 78 | 79 | ``` 80 | Task<KeyLifecycleRule> KeyLifecycleRule.Update( 81 | Nullable<Int64> id, 82 | Dictionary<string, object> parameters = null, 83 | Dictionary<string, object> options = null 84 | ) 85 | ``` 86 | 87 | ### Parameters 88 | 89 | * `id` (Nullable<Int64>): Required - Key Lifecycle Rule ID. 90 | * `key_type` (string): Key type for which the rule will apply (gpg or ssh). 91 | * `inactivity_days` (Nullable<Int64>): Number of days of inactivity before the rule applies. 92 | * `name` (string): Key Lifecycle Rule name 93 | 94 | 95 | --- 96 | 97 | ## Delete Key Lifecycle Rule 98 | 99 | ``` 100 | Task KeyLifecycleRule.Delete( 101 | Nullable<Int64> id, 102 | Dictionary<string, object> parameters = null, 103 | Dictionary<string, object> options = null 104 | ) 105 | ``` 106 | 107 | ### Parameters 108 | 109 | * `id` (Nullable<Int64>): Required - Key Lifecycle Rule ID. 110 | 111 | 112 | --- 113 | 114 | ## Update Key Lifecycle Rule 115 | 116 | ``` 117 | var KeyLifecycleRule = KeyLifecycleRule.Find(1); 118 | 119 | var parameters = new Dictionary<string, object>(); 120 | 121 | parameters.Add("key_type", "gpg"); 122 | parameters.Add("inactivity_days", 12); 123 | parameters.Add("name", "inactive gpg keys"); 124 | 125 | KeyLifecycleRule.Update(parameters); 126 | ``` 127 | 128 | ### Parameters 129 | 130 | * `id` (Nullable<Int64>): Required - Key Lifecycle Rule ID. 131 | * `key_type` (string): Key type for which the rule will apply (gpg or ssh). 132 | * `inactivity_days` (Nullable<Int64>): Number of days of inactivity before the rule applies. 133 | * `name` (string): Key Lifecycle Rule name 134 | 135 | 136 | --- 137 | 138 | ## Delete Key Lifecycle Rule 139 | 140 | ``` 141 | var KeyLifecycleRule = KeyLifecycleRule.Find(1); 142 | 143 | var parameters = new Dictionary<string, object>(); 144 | 145 | 146 | KeyLifecycleRule.Delete 147 | ``` 148 | 149 | ### Parameters 150 | 151 | * `id` (Nullable<Int64>): Required - Key Lifecycle Rule ID. 152 | -------------------------------------------------------------------------------- /docs/ShareGroup.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.ShareGroup 2 | 3 | ## Example ShareGroup Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "Test group 1", 9 | "notes": "This group is defined for testing purposes", 10 | "user_id": 1, 11 | "members": [ 12 | { 13 | "name": "John Doe", 14 | "company": "Acme Ltd", 15 | "email": "johndoe@gmail.com" 16 | } 17 | ] 18 | } 19 | ``` 20 | 21 | * `id` / `Id` (Nullable<Int64>): Share Group ID 22 | * `name` / `Name` (string): Name of the share group 23 | * `notes` / `Notes` (string): Additional notes of the share group 24 | * `user_id` / `UserId` (Nullable<Int64>): Owner User ID 25 | * `members` / `Members` (object[]): A list of share group members 26 | 27 | 28 | --- 29 | 30 | ## List Share Groups 31 | 32 | ``` 33 | Task<FilesList<ShareGroup>> ShareGroup.List( 34 | 35 | Dictionary<string, object> parameters = null, 36 | Dictionary<string, object> options = null 37 | ) 38 | ``` 39 | 40 | ### Parameters 41 | 42 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 43 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 44 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 45 | 46 | 47 | --- 48 | 49 | ## Show Share Group 50 | 51 | ``` 52 | Task<ShareGroup> ShareGroup.Find( 53 | Nullable<Int64> id, 54 | Dictionary<string, object> parameters = null, 55 | Dictionary<string, object> options = null 56 | ) 57 | ``` 58 | 59 | ### Parameters 60 | 61 | * `id` (Nullable<Int64>): Required - Share Group ID. 62 | 63 | 64 | --- 65 | 66 | ## Create Share Group 67 | 68 | ``` 69 | Task<ShareGroup> ShareGroup.Create( 70 | 71 | Dictionary<string, object> parameters = null, 72 | Dictionary<string, object> options = null 73 | ) 74 | ``` 75 | 76 | ### Parameters 77 | 78 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 79 | * `notes` (string): Additional notes of the share group 80 | * `name` (string): Required - Name of the share group 81 | * `members` (object[]): Required - A list of share group members. 82 | 83 | 84 | --- 85 | 86 | ## Update Share Group 87 | 88 | ``` 89 | Task<ShareGroup> ShareGroup.Update( 90 | Nullable<Int64> id, 91 | Dictionary<string, object> parameters = null, 92 | Dictionary<string, object> options = null 93 | ) 94 | ``` 95 | 96 | ### Parameters 97 | 98 | * `id` (Nullable<Int64>): Required - Share Group ID. 99 | * `notes` (string): Additional notes of the share group 100 | * `name` (string): Name of the share group 101 | * `members` (object[]): A list of share group members. 102 | 103 | 104 | --- 105 | 106 | ## Delete Share Group 107 | 108 | ``` 109 | Task ShareGroup.Delete( 110 | Nullable<Int64> id, 111 | Dictionary<string, object> parameters = null, 112 | Dictionary<string, object> options = null 113 | ) 114 | ``` 115 | 116 | ### Parameters 117 | 118 | * `id` (Nullable<Int64>): Required - Share Group ID. 119 | 120 | 121 | --- 122 | 123 | ## Update Share Group 124 | 125 | ``` 126 | var ShareGroup = ShareGroup.Find(1); 127 | 128 | var parameters = new Dictionary<string, object>(); 129 | 130 | parameters.Add("notes", "This group is defined for testing purposes"); 131 | parameters.Add("name", "Test group 1"); 132 | parameters.Add("members", [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}]); 133 | 134 | ShareGroup.Update(parameters); 135 | ``` 136 | 137 | ### Parameters 138 | 139 | * `id` (Nullable<Int64>): Required - Share Group ID. 140 | * `notes` (string): Additional notes of the share group 141 | * `name` (string): Name of the share group 142 | * `members` (object[]): A list of share group members. 143 | 144 | 145 | --- 146 | 147 | ## Delete Share Group 148 | 149 | ``` 150 | var ShareGroup = ShareGroup.Find(1); 151 | 152 | var parameters = new Dictionary<string, object>(); 153 | 154 | 155 | ShareGroup.Delete 156 | ``` 157 | 158 | ### Parameters 159 | 160 | * `id` (Nullable<Int64>): Required - Share Group ID. 161 | -------------------------------------------------------------------------------- /docs/Message.md: -------------------------------------------------------------------------------- 1 | # FilesCom.Models.Message 2 | 3 | ## Example Message Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "subject": "Files.com Account Upgrade", 9 | "body": "We should upgrade our Files.com account!", 10 | "comments": [ 11 | { 12 | "id": 1, 13 | "body": "What a great idea, thank you!", 14 | "reactions": [ 15 | { 16 | "id": 1, 17 | "emoji": "👍" 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | ``` 24 | 25 | * `id` / `Id` (Nullable<Int64>): Message ID 26 | * `subject` / `Subject` (string): Message subject. 27 | * `body` / `Body` (string): Message body. 28 | * `comments` / `Comments` (object[]): Comments. 29 | * `user_id` / `UserId` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 30 | * `project_id` / `ProjectId` (Nullable<Int64>): Project to which the message should be attached. 31 | 32 | 33 | --- 34 | 35 | ## List Messages 36 | 37 | ``` 38 | Task<FilesList<Message>> Message.List( 39 | 40 | Dictionary<string, object> parameters = null, 41 | Dictionary<string, object> options = null 42 | ) 43 | ``` 44 | 45 | ### Parameters 46 | 47 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 48 | * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination. 49 | * `per_page` (Nullable<Int64>): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 50 | * `project_id` (Nullable<Int64>): Required - Project for which to return messages. 51 | 52 | 53 | --- 54 | 55 | ## Show Message 56 | 57 | ``` 58 | Task<Message> Message.Find( 59 | Nullable<Int64> id, 60 | Dictionary<string, object> parameters = null, 61 | Dictionary<string, object> options = null 62 | ) 63 | ``` 64 | 65 | ### Parameters 66 | 67 | * `id` (Nullable<Int64>): Required - Message ID. 68 | 69 | 70 | --- 71 | 72 | ## Create Message 73 | 74 | ``` 75 | Task<Message> Message.Create( 76 | 77 | Dictionary<string, object> parameters = null, 78 | Dictionary<string, object> options = null 79 | ) 80 | ``` 81 | 82 | ### Parameters 83 | 84 | * `user_id` (Nullable<Int64>): User ID. Provide a value of `0` to operate the current session's user. 85 | * `project_id` (Nullable<Int64>): Required - Project to which the message should be attached. 86 | * `subject` (string): Required - Message subject. 87 | * `body` (string): Required - Message body. 88 | 89 | 90 | --- 91 | 92 | ## Update Message 93 | 94 | ``` 95 | Task<Message> Message.Update( 96 | Nullable<Int64> id, 97 | Dictionary<string, object> parameters = null, 98 | Dictionary<string, object> options = null 99 | ) 100 | ``` 101 | 102 | ### Parameters 103 | 104 | * `id` (Nullable<Int64>): Required - Message ID. 105 | * `project_id` (Nullable<Int64>): Required - Project to which the message should be attached. 106 | * `subject` (string): Required - Message subject. 107 | * `body` (string): Required - Message body. 108 | 109 | 110 | --- 111 | 112 | ## Delete Message 113 | 114 | ``` 115 | Task Message.Delete( 116 | Nullable<Int64> id, 117 | Dictionary<string, object> parameters = null, 118 | Dictionary<string, object> options = null 119 | ) 120 | ``` 121 | 122 | ### Parameters 123 | 124 | * `id` (Nullable<Int64>): Required - Message ID. 125 | 126 | 127 | --- 128 | 129 | ## Update Message 130 | 131 | ``` 132 | var Message = Message.Find(1); 133 | 134 | var parameters = new Dictionary<string, object>(); 135 | 136 | parameters.Add("project_id", 1); 137 | parameters.Add("subject", "Files.com Account Upgrade"); 138 | parameters.Add("body", "We should upgrade our Files.com account!"); 139 | 140 | Message.Update(parameters); 141 | ``` 142 | 143 | ### Parameters 144 | 145 | * `id` (Nullable<Int64>): Required - Message ID. 146 | * `project_id` (Nullable<Int64>): Required - Project to which the message should be attached. 147 | * `subject` (string): Required - Message subject. 148 | * `body` (string): Required - Message body. 149 | 150 | 151 | --- 152 | 153 | ## Delete Message 154 | 155 | ``` 156 | var Message = Message.Find(1); 157 | 158 | var parameters = new Dictionary<string, object>(); 159 | 160 | 161 | Message.Delete 162 | ``` 163 | 164 | ### Parameters 165 | 166 | * `id` (Nullable<Int64>): Required - Message ID. 167 | --------------------------------------------------------------------------------