Example #1
0
 public HiDriveClient(IHiDriveAuthenticator authenticator)
 {
     Authenticator = authenticator ?? throw new ArgumentNullException(nameof(authenticator));
     _httpClient   = new HttpClient {
         BaseAddress = new Uri(ApiUrl), Timeout = Timeout.InfiniteTimeSpan
     };
     _httpClient.DefaultRequestHeaders.AcceptCharset.Add(new StringWithQualityHeaderValue("utf-8"));
     _httpClient.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
     Directory = new DirectoryRequestBuilder(this);
     File      = new FileRequestBuilder(this);
     Meta      = new MetaRequestBuilder(this);
     User      = new UserRequestBuilder(this);
 }
Example #2
0
        public Command BuildDirectoryCommand()
        {
            var command = new Command("directory");
            var builder = new DirectoryRequestBuilder(PathParameters, RequestAdapter);

            command.AddCommand(builder.BuildDeleteCommand());
            command.AddCommand(builder.BuildGetCommand());
            command.AddCommand(builder.BuildPatchCommand());
            command.AddCommand(builder.BuildRoleAssignmentScheduleInstancesCommand());
            command.AddCommand(builder.BuildRoleAssignmentScheduleRequestsCommand());
            command.AddCommand(builder.BuildRoleAssignmentSchedulesCommand());
            command.AddCommand(builder.BuildRoleAssignmentsCommand());
            command.AddCommand(builder.BuildRoleDefinitionsCommand());
            command.AddCommand(builder.BuildRoleEligibilityScheduleInstancesCommand());
            command.AddCommand(builder.BuildRoleEligibilityScheduleRequestsCommand());
            command.AddCommand(builder.BuildRoleEligibilitySchedulesCommand());
            return(command);
        }