Class RemoteServiceOptions
- Namespace
- GroupeIsa.Neos.ClusterCommunication
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Represents the implementation of the IRemoteServiceInvoker immutable options.
public class RemoteServiceOptions
- Inheritance
-
RemoteServiceOptions
- Inherited Members
Constructors
RemoteServiceOptions()
Initializes a new instance of the RemoteServiceOptions class.
public RemoteServiceOptions()
RemoteServiceOptions(string)
Initializes a new instance of the RemoteServiceOptions class.
public RemoteServiceOptions(string clusterName)
Parameters
clusterNamestringThe cluster name for a Neos Cluster.
Fields
ApiPrefix
Represents the API prefix.
public const string ApiPrefix = "api"
Field Value
DefaultApiVersion
Represents the current API version.
public const string DefaultApiVersion = "v1"
Field Value
JsonContentType
Represents the JSON content type.
public const string JsonContentType = "application/json"
Field Value
MethodResourceName
Represents the method resource name.
public const string MethodResourceName = "methods"
Field Value
PlainTextContentType
Represents the text content type.
public const string PlainTextContentType = "text/plain"
Field Value
Properties
ApiVersion
Gets The API version.
public string ApiVersion { get; }
Property Value
Body
Gets the body.
public object? Body { get; }
Property Value
CancellationToken
Gets the cancellation token.
public CancellationToken CancellationToken { get; }
Property Value
Endpoint
Gets the network resource or service.
public string Endpoint { get; }
Property Value
Filter
Gets the filter.
public string? Filter { get; }
Property Value
HasApiPrefix
Gets a value indicating whether the route has API prefix.
public bool HasApiPrefix { get; }
Property Value
Headers
Gets the request headers.
public IDictionary<string, string>? Headers { get; }
Property Value
HttpMethod
Gets the HTTP method.
public HttpMethod HttpMethod { get; }
Property Value
KeyValues
Gets the key values.
public object? KeyValues { get; }
Property Value
MediaType
Gets the media type.
public string MediaType { get; }
Property Value
OrderBy
Gets the sort order.
public string? OrderBy { get; }
Property Value
Path
Gets the path.
public string Path { get; }
Property Value
QueryParameters
Gets the key query parameter collection.
public IList<RemoteServiceParameter>? QueryParameters { get; }
Property Value
ServiceId
Gets the service identifier.
public string ServiceId { get; }
Property Value
Remarks
If the service is a Neos cluster, it's the name of the cluster.
ServiceType
Gets the service type.
public NeosServiceType ServiceType { get; }
Property Value
Skip
Gets the number of items to skip.
public int? Skip { get; }
Property Value
- int?
TargetedVersion
Gets the targeted version.
public string? TargetedVersion { get; }
Property Value
Remarks
If null the targeted version will be resolved depending on the tenant.
TenantIdentifier
Gets the tenant identifier to invoke a cluster Neos with a specific tenant.
public string? TenantIdentifier { get; }
Property Value
Remarks
If null the target tenant is the same as the current tenant.
Top
Gets the number of items to return. If left unspecified, the value of 10 will be used by the EntityViewController (see GroupeIsa.Neos.AspNetCore.Controllers.QueryArguments.Top) (REF. bug/26514).
public int? Top { get; }
Property Value
- int?
UserIdentifier
Gets the user identifier to invoke a cluster Neos with a specific user.
public string? UserIdentifier { get; }
Property Value
Remarks
If null the target user is the same as the current user.
Methods
WithApiPrefix(bool)
Sets a value indicating whether the request is a API call.
public RemoteServiceOptions WithApiPrefix(bool value)
Parameters
valuebooltrueif the request is a API call; otherwise,false.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithApiVersion(string)
Sets the API version.
public RemoteServiceOptions WithApiVersion(string value)
Parameters
valuestringThe API version.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithApiVersionNeutral()
Sets versionless API.
public RemoteServiceOptions WithApiVersionNeutral()
Returns
- RemoteServiceOptions
This instance for fluent code.
WithBody(HttpContent)
Sets the http content as the data.
public RemoteServiceOptions WithBody(HttpContent httpContent)
Parameters
httpContentHttpContentThe http contents.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithBody(object?)
Sets the data.
It will be serialized into json content.
public RemoteServiceOptions WithBody(object? value)
Parameters
valueobjectThe data.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithCancellationToken(CancellationToken)
Sets the cancellation token.
[Obsolete("Use overloaded method with cancellation argument")]
public RemoteServiceOptions WithCancellationToken(CancellationToken value)
Parameters
valueCancellationTokenThe cancellation token.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithDefaultApiVersion()
Sets the default API version.
public RemoteServiceOptions WithDefaultApiVersion()
Returns
- RemoteServiceOptions
This instance for fluent code.
WithFilter(string?)
Sets the filter.
public RemoteServiceOptions WithFilter(string? value)
Parameters
valuestringThe filter.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithHeader(string, string)
Adds a header.
public RemoteServiceOptions WithHeader(string name, string value)
Parameters
Returns
- RemoteServiceOptions
This instance for fluent code.
WithHeaders(IDictionary<string, string>?)
Sets the headers.
public RemoteServiceOptions WithHeaders(IDictionary<string, string>? values)
Parameters
valuesIDictionary<string, string>The headers to use.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithHttpMethod(HttpMethod)
Sets the HTTP method.
public RemoteServiceOptions WithHttpMethod(HttpMethod value)
Parameters
valueHttpMethodThe HTTP method.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithKeyValues(object?)
Sets the key values.
public RemoteServiceOptions WithKeyValues(object? values)
Parameters
valuesobjectThe key values.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithMediaType(string)
Sets the media type.
public RemoteServiceOptions WithMediaType(string value)
Parameters
valuestringThe media type.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithOrderBy(string?)
Sets the sort order.
public RemoteServiceOptions WithOrderBy(string? value)
Parameters
valuestringThe filter.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithPath(string)
Sets the path.
public RemoteServiceOptions WithPath(string value)
Parameters
valuestringThe path.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithQueryParameter(RemoteServiceParameter)
Adds a parameter.
public RemoteServiceOptions WithQueryParameter(RemoteServiceParameter value)
Parameters
valueRemoteServiceParameterThe parameter to add.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithQueryParameter(string, object?)
Adds a parameter.
public RemoteServiceOptions WithQueryParameter(string name, object? value)
Parameters
Returns
- RemoteServiceOptions
This instance for fluent code.
WithQueryParameters(IDictionary<string, object?>?)
Sets the parameters.
public RemoteServiceOptions WithQueryParameters(IDictionary<string, object?>? values)
Parameters
valuesIDictionary<string, object>The parameters to use.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithQueryParameters(IEnumerable<RemoteServiceParameter>?)
Sets the parameters.
public RemoteServiceOptions WithQueryParameters(IEnumerable<RemoteServiceParameter>? values)
Parameters
valuesIEnumerable<RemoteServiceParameter>The parameters to use.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithServiceType(NeosServiceType)
Sets the service type.
public RemoteServiceOptions WithServiceType(NeosServiceType serviceType)
Parameters
serviceTypeNeosServiceTypeThe service type.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithSkip(int?)
Sets the number of items to skip.
public RemoteServiceOptions WithSkip(int? value)
Parameters
valueint?The number of items to skip.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithTargetedVersion(string)
Sets the targeted version.
When the targeted version is set, the service of the specified cluster will be invoked with the specified version, regardless of the tenant.
When the targeted version is not set, the service of the specified cluster will be invoked with the version resolved depending on the tenant.
public RemoteServiceOptions WithTargetedVersion(string version)
Parameters
versionstringThe targeted version.
Returns
- RemoteServiceOptions
This instance.
WithTenantIdentifier(string)
Sets the tenant identifier to invoke a cluster Neos with a specific tenant.
public RemoteServiceOptions WithTenantIdentifier(string tenantIdentifier)
Parameters
tenantIdentifierstringThe tenant identifier.
Returns
- RemoteServiceOptions
This instance.
Remarks
Without calling WithTenantIdentifier(string), the target tenant is the same as the current tenant (if the current cluster is multi-tenant).
WithTop(int?)
Sets the number of items to return.
public RemoteServiceOptions WithTop(int? value)
Parameters
valueint?The number of items to return.
Returns
- RemoteServiceOptions
This instance for fluent code.
WithUserIdentifier(string)
Sets the user identifier to invoke a cluster Neos with a specific user.
public RemoteServiceOptions WithUserIdentifier(string userIdentifier)
Parameters
userIdentifierstringThe user identifier.
Returns
- RemoteServiceOptions
This instance.
Remarks
Without calling WithUserIdentifier(string), the target user is the same as the current user.