Skip to content

Commit

Permalink
fix: Fix metadata filter resource (box/box-openapi#419) (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build authored May 10, 2024
1 parent 450a46d commit 8c119e7
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "afd7974", "specHash": "a8c36df", "version": "0.3.0" }
{ "engineHash": "36bf5da", "specHash": "f7e92ba", "version": "0.3.0" }
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public enum GetEventsQueryParamsEventTypeField {
GroupRemoveItem,
[Description("GROUP_REMOVE_USER")]
GroupRemoveUser,
[Description("ITEM_EMAIL_SEND")]
ItemEmailSend,
[Description("ITEM_MODIFY")]
ItemModify,
[Description("ITEM_OPEN")]
Expand Down Expand Up @@ -153,6 +155,8 @@ public enum GetEventsQueryParamsEventTypeField {
RetentionPolicyAssignmentAdd,
[Description("SHARE")]
Share,
[Description("SHARED_LINK_SEND")]
SharedLinkSend,
[Description("SHARE_EXPIRATION")]
ShareExpiration,
[Description("SHIELD_ALERT")]
Expand Down
11 changes: 3 additions & 8 deletions Box.Sdk.Gen/Managers/Search/SearchForContentQueryParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,9 @@ public class SearchForContentQueryParams {
public SearchForContentQueryParamsTrashContentField? TrashContent { get; set; } = default;

/// <summary>
/// Limits the search results to any items for which the metadata matches
/// the provided filter.
///
/// This parameter contains a list of 1 metadata template to filter
/// the search results by. This list can currently only
/// contain one entry, though this might be expanded in the future.
///
/// This parameter is required unless the `query` parameter is provided.
/// 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 is required unless the `query` parameter is provided.
/// </summary>
public IReadOnlyList<MetadataFilter>? Mdfilters { get; set; } = default;

Expand Down
4 changes: 4 additions & 0 deletions Box.Sdk.Gen/Schemas/EventEventTypeField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public enum EventEventTypeField {
ItemCreate,
[Description("ITEM_DOWNLOAD")]
ItemDownload,
[Description("ITEM_EMAIL_SEND")]
ItemEmailSend,
[Description("ITEM_MAKE_CURRENT_VERSION")]
ItemMakeCurrentVersion,
[Description("ITEM_MODIFY")]
Expand Down Expand Up @@ -193,6 +195,8 @@ public enum EventEventTypeField {
RetentionPolicyAssignmentAdd,
[Description("SHARE")]
Share,
[Description("SHARED_LINK_SEND")]
SharedLinkSend,
[Description("SHARE_EXPIRATION")]
ShareExpiration,
[Description("SHIELD_ALERT")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text.Json;

namespace Box.Sdk.Gen.Schemas {
public class MetadataFieldFilterDateRangeValue {
public class MetadataFieldFilterDateRange {
/// <summary>
/// Specifies the (inclusive) upper bound for the metadata field
/// value. The value of a field must be lower than (`lt`) or
Expand All @@ -25,7 +25,7 @@ public class MetadataFieldFilterDateRangeValue {
[JsonPropertyName("gt")]
public System.DateTimeOffset? Gt { get; set; } = default;

public MetadataFieldFilterDateRangeValue() {
public MetadataFieldFilterDateRange() {

}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Unions;
using System.Text.Json.Serialization;
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Text.Json;

namespace Box.Sdk.Gen.Schemas {
[JsonConverter(typeof(MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrStringConverter))]
public class MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString : OneOf<MetadataFieldFilterDateRange, MetadataFieldFilterFloatRange, IReadOnlyList<string>, double, string> {
public MetadataFieldFilterDateRange? MetadataFieldFilterDateRange => _val0;

public MetadataFieldFilterFloatRange? MetadataFieldFilterFloatRange => _val1;

public IReadOnlyList<string>? IReadOnlyList<string> => _val2;

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Identifier expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Syntax error, '>' expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Syntax error, '(' expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Identifier expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Syntax error, ',' expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Syntax error, ',' expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Identifier expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

) expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Identifier expected

Check failure on line 15 in Box.Sdk.Gen/Schemas/MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Syntax error, '>' expected

public double? DoubleVal => _val3;

public string? StringVal => _val4;

public MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(MetadataFieldFilterDateRange value) : base(value) {}

public MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(MetadataFieldFilterFloatRange value) : base(value) {}

public MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(IReadOnlyList<string> value) : base(value) {}

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

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

public static implicit operator MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(MetadataFieldFilterDateRange value) => new MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(value);

public static implicit operator MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(MetadataFieldFilterFloatRange value) => new MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(value);

public static implicit operator MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(IReadOnlyList<string> value) => new MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(value);

public static implicit operator MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(double value) => new MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(value);

public static implicit operator MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(string value) => new MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text.Json;

namespace Box.Sdk.Gen.Schemas {
public class MetadataFieldFilterFloatRangeValue {
public class MetadataFieldFilterFloatRange {
/// <summary>
/// Specifies the (inclusive) upper bound for the metadata field
/// value. The value of a field must be lower than (`lt`) or
Expand All @@ -25,7 +25,7 @@ public class MetadataFieldFilterFloatRangeValue {
[JsonPropertyName("gt")]
public double? Gt { get; set; } = default;

public MetadataFieldFilterFloatRangeValue() {
public MetadataFieldFilterFloatRange() {

}
}
Expand Down
10 changes: 8 additions & 2 deletions Box.Sdk.Gen/Schemas/MetadataFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MetadataFilter {
public MetadataFilterScopeField? Scope { get; set; } = default;

/// <summary>
/// The key of the template to filter search results by.
/// The key of the template used to filter search results.
///
/// In many cases the template key is automatically derived
/// of its display name, for example `Contract Template` would
Expand All @@ -36,8 +36,14 @@ public class MetadataFilter {
[JsonPropertyName("templateKey")]
public string? TemplateKey { get; set; } = default;

/// <summary>
/// Specifies which fields on the template to filter the search
/// results by. When more than one field is specified, the query
/// performs a logical `AND` to ensure that the instance of the
/// template matches each of the fields specified.
/// </summary>
[JsonPropertyName("filters")]
public MetadataFilterFiltersField? Filters { get; set; } = default;
public Dictionary<string, MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString>? Filters { get; set; } = default;

public MetadataFilter() {

Expand Down
103 changes: 0 additions & 103 deletions Box.Sdk.Gen/Schemas/MetadataFilterFiltersField.cs

This file was deleted.

0 comments on commit 8c119e7

Please sign in to comment.