Skip to content

Commit

Permalink
fix: Fix schemas for updating classification on a file and folder (bo…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed May 16, 2024
1 parent 4b00325 commit d77aaf5
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "c8ba3d9", "specHash": "d5769a1", "version": "0.3.1" }
{ "engineHash": "c8ba3d9", "specHash": "98bca8f", "version": "0.3.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface ILegalHoldPolicyAssignmentsManager {

public System.Threading.Tasks.Task DeleteLegalHoldPolicyAssignmentByIdAsync(string legalHoldPolicyAssignmentId, DeleteLegalHoldPolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null);

public System.Threading.Tasks.Task<FileVersionLegalHolds> GetLegalHoldPolicyAssignmentFileOnHoldAsync(string legalHoldPolicyAssignmentId, GetLegalHoldPolicyAssignmentFileOnHoldQueryParams? queryParams = default, GetLegalHoldPolicyAssignmentFileOnHoldHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null);
public System.Threading.Tasks.Task<FilesOnHold> GetLegalHoldPolicyAssignmentFileOnHoldAsync(string legalHoldPolicyAssignmentId, GetLegalHoldPolicyAssignmentFileOnHoldQueryParams? queryParams = default, GetLegalHoldPolicyAssignmentFileOnHoldHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public async System.Threading.Tasks.Task DeleteLegalHoldPolicyAssignmentByIdAsyn
}

/// <summary>
/// Get a list of current file versions for a legal hold
/// Get a list of files with current file versions for a legal hold
/// assignment.
///
/// In some cases you may want to get previous file versions instead. In these
Expand Down Expand Up @@ -131,13 +131,13 @@ public async System.Threading.Tasks.Task DeleteLegalHoldPolicyAssignmentByIdAsyn
/// <param name="cancellationToken">
/// Token used for request cancellation.
/// </param>
public async System.Threading.Tasks.Task<FileVersionLegalHolds> GetLegalHoldPolicyAssignmentFileOnHoldAsync(string legalHoldPolicyAssignmentId, GetLegalHoldPolicyAssignmentFileOnHoldQueryParams? queryParams = default, GetLegalHoldPolicyAssignmentFileOnHoldHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
public async System.Threading.Tasks.Task<FilesOnHold> GetLegalHoldPolicyAssignmentFileOnHoldAsync(string legalHoldPolicyAssignmentId, GetLegalHoldPolicyAssignmentFileOnHoldQueryParams? queryParams = default, GetLegalHoldPolicyAssignmentFileOnHoldHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
queryParams = queryParams ?? new GetLegalHoldPolicyAssignmentFileOnHoldQueryParams();
headers = headers ?? new GetLegalHoldPolicyAssignmentFileOnHoldHeaders();
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } });
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId), "/files_on_hold"), new FetchOptions(method: "GET", parameters: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.Auth, networkSession: this.NetworkSession, cancellationToken: cancellationToken)).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<FileVersionLegalHolds>(response.Data);
return SimpleJsonSerializer.Deserialize<FilesOnHold>(response.Data);
}

}
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Managers/Search/SearchForContentQueryParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public class SearchForContentQueryParams {
/// <summary>
/// Limits the search results to any items for which the metadata matches the provided filter.
/// This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
/// It unless the `query` parameter is provided.
/// It is required unless the `query` parameter is provided.
/// </summary>
public IReadOnlyList<MetadataFilter>? Mdfilters { get; set; } = default;

Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Schemas/Events/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Events {
/// of events.
/// </summary>
[JsonPropertyName("next_stream_position")]
public string? NextStreamPosition { get; set; } = default;
public EventsNextStreamPositionField? NextStreamPosition { get; set; } = default;

/// <summary>
/// A list of events
Expand Down
18 changes: 18 additions & 0 deletions Box.Sdk.Gen/Schemas/Events/EventsNextStreamPositionField.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Unions;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Schemas {
public class EventsNextStreamPositionField : OneOf<string, double> {
public string? StringVal => _val0;

public double? DoubleVal => _val1;

public EventsNextStreamPositionField(string value) : base(value) {}

public EventsNextStreamPositionField(double value) : base(value) {}

public static implicit operator EventsNextStreamPositionField(string value) => new EventsNextStreamPositionField(value);

public static implicit operator EventsNextStreamPositionField(double value) => new EventsNextStreamPositionField(value);
}
}
4 changes: 3 additions & 1 deletion Box.Sdk.Gen/Schemas/File/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
namespace Box.Sdk.Gen.Schemas {
public class File : FileMini {
/// <summary>
/// The optional description of this file
/// The optional description of this file.
/// If the description exceeds 255 characters, the first 255 characters
/// are set as a file description and the rest of it is ignored.
/// </summary>
[JsonPropertyName("description")]
public string? Description { get; set; } = default;
Expand Down
40 changes: 40 additions & 0 deletions Box.Sdk.Gen/Schemas/FileVersionsOnHold/FileVersionsOnHold.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Unions;
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Schemas {
public class FileVersionsOnHold {
/// <summary>
/// The limit that was used for these entries. This will be the same as the
/// `limit` query parameter unless that value exceeded the maximum value
/// allowed. The maximum value varies by API.
/// </summary>
[JsonPropertyName("limit")]
public long? Limit { get; set; } = default;

/// <summary>
/// The marker for the start of the next page of results.
/// </summary>
[JsonPropertyName("next_marker")]
public string? NextMarker { get; set; } = default;

/// <summary>
/// The marker for the start of the previous page of results.
/// </summary>
[JsonPropertyName("prev_marker")]
public string? PrevMarker { get; set; } = default;

/// <summary>
/// A list of file versions on hold.
/// </summary>
[JsonPropertyName("entries")]
public IReadOnlyList<FileVersion>? Entries { get; set; } = default;

public FileVersionsOnHold() {

}
}
}
40 changes: 40 additions & 0 deletions Box.Sdk.Gen/Schemas/FilesOnHold/FilesOnHold.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Unions;
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Schemas {
public class FilesOnHold {
/// <summary>
/// The limit that was used for these entries. This will be the same as the
/// `limit` query parameter unless that value exceeded the maximum value
/// allowed. The maximum value varies by API.
/// </summary>
[JsonPropertyName("limit")]
public long? Limit { get; set; } = default;

/// <summary>
/// The marker for the start of the next page of results.
/// </summary>
[JsonPropertyName("next_marker")]
public string? NextMarker { get; set; } = default;

/// <summary>
/// The marker for the start of the previous page of results.
/// </summary>
[JsonPropertyName("prev_marker")]
public string? PrevMarker { get; set; } = default;

/// <summary>
/// A list of files
/// </summary>
[JsonPropertyName("entries")]
public IReadOnlyList<FileMini>? Entries { get; set; } = default;

public FilesOnHold() {

}
}
}
4 changes: 2 additions & 2 deletions Box.Sdk.Gen/Schemas/RealtimeServer/RealtimeServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public class RealtimeServer {
/// The time in minutes for which this server is available
/// </summary>
[JsonPropertyName("ttl")]
public long? Ttl { get; set; } = default;
public string? Ttl { get; set; } = default;

/// <summary>
/// The maximum number of retries this server will
/// allow before a new long poll should be started by
/// getting a [new list of server](#options-events).
/// </summary>
[JsonPropertyName("max_retries")]
public long? MaxRetries { get; set; } = default;
public string? MaxRetries { get; set; } = default;

/// <summary>
/// The maximum number of seconds without a response
Expand Down
8 changes: 4 additions & 4 deletions docs/LegalHoldPolicyAssignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [Assign legal hold policy](#assign-legal-hold-policy)
- [Get legal hold policy assignment](#get-legal-hold-policy-assignment)
- [Unassign legal hold policy](#unassign-legal-hold-policy)
- [List current file versions for legal hold policy assignment](#list-current-file-versions-for-legal-hold-policy-assignment)
- [List files with current file versions for legal hold policy assignment](#list-files-with-current-file-versions-for-legal-hold-policy-assignment)

## List legal hold policy assignments

Expand Down Expand Up @@ -135,9 +135,9 @@ A blank response is returned if the assignment was
successfully deleted.


## List current file versions for legal hold policy assignment
## List files with current file versions for legal hold policy assignment

Get a list of current file versions for a legal hold
Get a list of files with current file versions for a legal hold
assignment.

In some cases you may want to get previous file versions instead. In these
Expand Down Expand Up @@ -175,7 +175,7 @@ See the endpoint docs at

### Returns

This function returns a value of type `FileVersionLegalHolds`.
This function returns a value of type `FilesOnHold`.

Returns the list of current file versions held under legal hold for a
specific legal hold policy assignment.
Expand Down

0 comments on commit d77aaf5

Please sign in to comment.