Represents a request operation in the Cascade library. It encapsulates all necessary details such as the type, verb, id, value, etc. More...
Public Member Functions | |
| RequestOp (long timeMs, Type? type, RequestVerb verb, object? id, object? value=null, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, object? criteria=null, string? key=null, object? extra=null, string? eTag=null, bool? localOnly=null) | |
| Initializes a new instance of the RequestOp class with the provided details. | |
| RequestOp | CloneWith (long? timeMs=null, Type? type=null, RequestVerb? verb=null, object? id=null, object? value=null, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, object? criteria=null, string? key=null, object? extra=null, string? eTag=null, bool? localOnly=null) |
| Creates a new instance of RequestOp by cloning the current instance and optionally modifying its properties. | |
| string | ToSummaryString () |
| Converts the operation details into a concise summary string for logging or display purposes. | |
Static Public Member Functions | |
| static RequestOp | GetOp< Model > (object id, long timeMs=-1, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, object? criteria=null, bool? localOnly=null) |
| Constructs a "Get" operation for a specific model type, with optional parameters for population and freshness. | |
| static RequestOp | GetOp (Type modelType, object id, long timeMs=-1, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, object? criteria=null, bool? localOnly=null) |
| Constructs a "Get" operation for a specified type with additional configuration options. | |
| static RequestOp | BlobGetOp (string path, long timeMs=-1, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, string? eTag=null, bool? localOnly=null) |
| Constructs a "BlobGet" operation for retrieving a binary large object at a specified path. | |
| static RequestOp | BlobGetFilePathOp (string path, long timeMs=-1, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, string? eTag=null, bool? localOnly=null) |
| Constructs a "BlobGetFilePath" operation for retrieving the absolute path to a binary large object at a specified path. | |
| static RequestOp | BlobPutOp (string path, long timeMs, object? data, bool? hold=null, object? criteria=null, bool? localOnly=null) |
| Constructs a "BlobPut" operation for storing a binary large object at a specified path. | |
| static RequestOp | BlobDestroyOp (string path, long timeMs, object? criteria=null) |
| Constructs a "BlobDestroy" operation for deleting a binary large object at a specified path. | |
| static RequestOp | GetCollectionOp< Model > (string collectionName, long timeMs=-1, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null) |
| Constructs a "GetCollection" operation for retrieving a collection of model ids. | |
| static RequestOp | QueryOp< Model > (string? collectionName, object? criteria, long timeMs, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, bool? localOnly=null) |
| Constructs a "Query" operation for querying a collection of models with specific criteria. | |
| static RequestOp | CreateOp (object model, long timeMs, bool hold=false, object? criteria=null, bool? localOnly=null) |
| Constructs a "Create" operation for creating a new model instance. | |
| static RequestOp | DestroyOp< Model > (Model model, long timeMs, object? criteria=null, bool? localOnly=null) |
| Constructs a "Destroy" operation for deleting a specified model instance. | |
| static RequestOp | ReplaceOp< Model > (Model model, long timeMs, object? criteria=null, bool? localOnly=null) |
| Constructs a "Replace" operation for replacing an existing model instance. | |
| static RequestOp | UpdateOp< Model > (Model model, IDictionary< string, object?> changes, long timeMs, object? criteria=null, bool? localOnly=null) |
| Constructs an "Update" operation for updating an existing model instance with specified changes. | |
| static RequestOp | ExecuteOp< OriginClass, ReturnType > (string action, IDictionary< string, object?> parameters, long timeMs) |
| Constructs an "Execute" operation to perform a custom action with specified parameters. | |
| static bool | IsWriteVerb (RequestVerb aVerb) |
| Determines if a specified RequestVerb is associated with write operations such as Create, Update, or Execute. | |
| static RequestVerb | VerbFromString (string aString) |
| Parses a string to a corresponding RequestVerb. If parsing fails, it returns RequestVerb.None. | |
Public Attributes | |
| readonly long | TimeMs |
| readonly? Type | Type |
| readonly RequestVerb | Verb |
| readonly? object | Id |
| readonly? object | Value |
| readonly? string | Key |
| readonly? object | Criteria |
| readonly? object | Extra |
| readonly? string | ETag |
| readonly? bool | LocalOnly |
| readonly? IEnumerable< string > | Populate |
| readonly int | FreshnessSeconds = FRESHNESS_DEFAULT |
| readonly int | PopulateFreshnessSeconds = FRESHNESS_DEFAULT |
| readonly int | FallbackFreshnessSeconds = FALLBACK_ANY |
| readonly bool | Hold |
| readonly IDictionary< string, string > | Params |
| readonly long | FreshAfterMs |
| readonly long | PopulateFreshAfterMs |
| readonly long | FallbackFreshAfterMs |
Represents a request operation in the Cascade library. It encapsulates all necessary details such as the type, verb, id, value, etc.
|
inline |
Initializes a new instance of the RequestOp class with the provided details.
| timeMs | The timestamp in milliseconds when the request was created. |
| type | The type of the model associated with the request. |
| verb | The operation type represented by a verb. |
| id | The identifier of the model for requests involving a specific instance. |
| value | The value associated with the request, such as the model or changes. |
| populate | A collection indicating associations to be populated, if applicable. |
| freshnessSeconds | Desired freshness of the returned data in seconds. |
| populateFreshnessSeconds | Desired freshness for populated relations in seconds. |
| fallbackFreshnessSeconds | Fallback freshness in seconds to use if main freshness cannot be satisfied. |
| hold | Specifies whether the request should be held for deferred processing. |
| criteria | Criteria for filtering results in certain operations like queries. |
| key | Identifier for collection-level operations instead of individual instances. |
| extra | Any additional data required by the request. |
| eTag | |
| localOnly |
|
inlinestatic |
Constructs a "BlobDestroy" operation for deleting a binary large object at a specified path.
| path | The path of the blob to be deleted. |
| timeMs | The timestamp in milliseconds when the request was created. |
| criteria |
|
inlinestatic |
Constructs a "BlobGetFilePath" operation for retrieving the absolute path to a binary large object at a specified path.
| path | The path of the blob to be retrieved. |
| timeMs | The timestamp in milliseconds when the request was created. If not specified, the current time is used. |
| freshnessSeconds | Indicates how fresh the blob data should be. Defaults to FRESHNESS_DEFAULT if not provided. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| eTag | |
| localOnly |
|
inlinestatic |
Constructs a "BlobGet" operation for retrieving a binary large object at a specified path.
| path | The path of the blob to be retrieved. |
| timeMs | The timestamp in milliseconds when the request was created. If not specified, the current time is used. |
| freshnessSeconds | Indicates how fresh the blob data should be. Defaults to FRESHNESS_DEFAULT if not provided. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| eTag | |
| localOnly |
|
inlinestatic |
Constructs a "BlobPut" operation for storing a binary large object at a specified path.
| path | The path where the blob will be stored. |
| timeMs | The timestamp in milliseconds when the request was created. |
| data | The byte array or stream representing the blob data to be stored. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| criteria | |
| localOnly |
|
inline |
Creates a new instance of RequestOp by cloning the current instance and optionally modifying its properties.
| timeMs | Optional new timestamp in milliseconds. |
| type | Optional new model type. |
| verb | Optional new operation type. |
| id | Optional new model identifier. |
| value | Optional new value associated with the request. |
| populate | Optional new relationships to populate. |
| freshnessSeconds | Optional new freshness requirement in seconds. |
| populateFreshnessSeconds | Optional new populate freshness in seconds. |
| fallbackFreshnessSeconds | Optional new fallback freshness in seconds. |
| hold | Optional new hold status. |
| criteria | Optional new criteria. |
| key | Optional new key for collection operations. |
| extra | Optional new extra data. |
| eTag | |
| localOnly |
|
inlinestatic |
Constructs a "Create" operation for creating a new model instance.
| model | The model instance to be created. |
| timeMs | The timestamp in milliseconds when the request was created. |
| hold | Specifies if the request should be held from processing. |
| criteria | |
| localOnly |
|
inlinestatic |
Constructs a "Destroy" operation for deleting a specified model instance.
| Model | The type of the model to be deleted. |
| model | The model instance to be deleted. |
| timeMs | The timestamp in milliseconds when the request was created. |
| criteria | |
| localOnly |
|
inlinestatic |
Constructs an "Execute" operation to perform a custom action with specified parameters.
| OriginClass | The class from which the action originates. |
| ReturnType | The expected return type from executing the action. |
| action | The name of the action to be executed. |
| parameters | A dictionary containing parameters required for the action. |
| timeMs | The timestamp in milliseconds when the request was created. |
|
inlinestatic |
Constructs a "GetCollection" operation for retrieving a collection of model ids.
| Model | The type of the model |
| collectionName | The name of the collection to be retrieved. |
| timeMs | The timestamp in milliseconds when the request was created. If not specified, the current time is used. |
| freshnessSeconds | |
| populateFreshnessSeconds | |
| fallbackFreshnessSeconds |
|
inlinestatic |
Constructs a "Get" operation for a specified type with additional configuration options.
| modelType | The type of the model to be retrieved. |
| id | The identifier for the model to be retrieved. |
| timeMs | The timestamp in milliseconds when the request was created. If not specified, the current time is used. |
| populate | Associations to be populated along with the model. |
| freshnessSeconds | Indicates how fresh the data should be. Defaults to FRESHNESS_DEFAULT if not provided. |
| populateFreshnessSeconds | Specific freshness requirement for populated relations. Defaults to FRESHNESS_DEFAULT if not provided. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| criteria | |
| localOnly |
|
inlinestatic |
Constructs a "Get" operation for a specific model type, with optional parameters for population and freshness.
| Model | The type of the model to be retrieved. |
| id | The identifier for the model to be retrieved. |
| timeMs | The timestamp in milliseconds when the request was created. If not specified, the current time is used. |
| populate | Collection of string relations to be populated along with the model. |
| freshnessSeconds | Indicates how fresh the data should be. Defaults to FRESHNESS_DEFAULT if not provided. |
| populateFreshnessSeconds | Specific freshness requirement for populated relations. Defaults to FRESHNESS_DEFAULT if not provided. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| criteria | |
| localOnly |
|
inlinestatic |
Determines if a specified RequestVerb is associated with write operations such as Create, Update, or Execute.
| aVerb | The RequestVerb to be checked. |
|
inlinestatic |
Constructs a "Query" operation for querying a collection of models with specific criteria.
| Model | The type of the models in the collection. |
| collectionName | The name of the collection to be queried. |
| criteria | The criteria used to filter models within the collection. |
| timeMs | The timestamp in milliseconds when the request was created. |
| populate | Collection of string relations to be populated along with the models. |
| freshnessSeconds | Indicates how fresh the data should be. Defaults to FRESHNESS_DEFAULT if not provided. |
| populateFreshnessSeconds | Specific freshness requirement for populated relations. Defaults to FRESHNESS_DEFAULT if not provided. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Specifies if the request should be held from processing. Defaults to null. |
| localOnly |
|
inlinestatic |
Constructs a "Replace" operation for replacing an existing model instance.
| Model | The type of the model to be replaced. |
| model | The model instance to be replaced. |
| timeMs | The timestamp in milliseconds when the request was created. |
| criteria | |
| localOnly |
|
inline |
Converts the operation details into a concise summary string for logging or display purposes.
Be aware that JsonSerializer.Serialize(Criteria) will throw an UnsupportedException in production (not development) if Criteria is an ImmutableDictionary.
|
inlinestatic |
Constructs an "Update" operation for updating an existing model instance with specified changes.
| Model | The type of the model to be updated. |
| model | The model instance to be updated. |
| changes | A dictionary containing the changes to be applied to the model. |
| timeMs | The timestamp in milliseconds when the request was created. |
| criteria | |
| localOnly |
|
inlinestatic |
Parses a string to a corresponding RequestVerb. If parsing fails, it returns RequestVerb.None.
| aString | The string to be parsed. |