Class WMHTTPConnectionDTO
Data Transfer Object proxy for a WMHTTPConnection.
Inheritance
Inherited Members
Namespace: Quantellia.WMServer.Asset.Model.HTTP
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMHTTPConnectionDTO : WMAssetBaseDTO<WMHTTPConnection>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity
Constructors
WMHTTPConnectionDTO()
Constructor for DTO
Declaration
public WMHTTPConnectionDTO()
WMHTTPConnectionDTO(string)
Constructor for DTO, with specified ID
Declaration
public WMHTTPConnectionDTO(string ID)
Parameters
Type | Name | Description |
---|---|---|
string | ID |
Properties
AuthenticationData
The authentication token, username/password, header name, etc... for this resource. Is AES-256 encrypted on the database. Is specific to the given AuthenticationType.
Declaration
[NotMapped]
public Dictionary<string, string> AuthenticationData { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
AuthenticationDataSerialized
Serializes to and from AuthenticationData
Declaration
public string AuthenticationDataSerialized { get; set; }
Property Value
Type | Description |
---|---|
string |
AuthenticationType
How this connection is expected to be authenticated.
Declaration
public WMHTTPConnection.AuthType AuthenticationType { get; set; }
Property Value
Type | Description |
---|---|
WMHTTPConnection.AuthType |
Endpoint
The base URL to form the connection with. Any trailing / will be trimmed. Any WMHTTPRequest using this connection can optionally specify additional routes on top of this base URL.
Declaration
public string Endpoint { get; set; }
Property Value
Type | Description |
---|---|
string |
Headers
Required headers and values for this resource. Can be overwritten by any WMHTTPRequest using this connection.
Declaration
[NotMapped]
public Dictionary<string, string> Headers { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
HeadersSerialized
Serializes to and from Headers
Declaration
public string HeadersSerialized { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Clone(WMPrincipal, WMAssetIdentifier, VersionCreateArgs?, WMAppDbContext)
Clones the specified asset with an iterated name "AssetName (1), etc... ", iterates the version number.
Declaration
public static Task<WMHTTPConnectionDTO> Clone(WMPrincipal principal, WMAssetIdentifier identifier, VersionCreateArgs? args, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
VersionCreateArgs | args | Arguments for creating a version. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<WMHTTPConnectionDTO> |
Exceptions
Type | Condition |
---|---|
Exception |
Commit(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Commits the specified asset as Head.
Declaration
public static Task Commit(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
Create(WMPrincipal, WMHTTPConnectionDTO, WMAppDbContext)
Create a new WMHTTPConnectionDTO from the provided data.
Declaration
public static Task<WMHTTPConnection> Create(WMPrincipal principal, WMHTTPConnectionDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data reader |
WMHTTPConnectionDTO | a_dto | The WMHTTPConnectionDTO to be created. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<WMHTTPConnection> |
Exceptions
Type | Condition |
---|---|
Exception |
Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Delete the WMHTTPConnectionDTO with the corresponding ID or FullPathName
Declaration
public static Task Delete(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
FromModel()
Create this instance by reading properties from the model.
Declaration
public override void FromModel()
Overrides
Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>>)
Gets the WMHTTPConnectionDTO instance with the specified id. Ensures ownership.
Declaration
public static Task<WMHTTPConnectionDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext? context = null, Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>> propertySelector = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context | |
Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
Type | Description |
---|---|
Task<WMHTTPConnectionDTO> |
GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>>)
Gets a listing of the specified WMHTTPConnectionDTO to the recursion depth specified with the ID/Dir of a WMAssetDirectory as input.
Declaration
public static Task<IEnumerable<WMHTTPConnectionDTO>> GetFromDirectory(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>> propertySelector = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the assets being requested. |
WMAssetIdentifier | identifier | The identifier of the asset |
int | recursionDepth | Depth to which the directory subtrees under the specified directory should be traversed. |
WMAppDbContext | context | Optional reference to a WMAppDbContext instance. |
Expression<Func<WMHTTPConnectionDTO, WMHTTPConnectionDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
Type | Description |
---|---|
Task<IEnumerable<WMHTTPConnectionDTO>> |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type | Description |
---|---|
WMResourceOperationsDefinition |
Update(WMPrincipal, WMAssetIdentifier, WMHTTPConnectionDTO, WMAppDbContext)
Updates the specified WMHTTPConnectionDTO from the provided data.
Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMHTTPConnectionDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the asset |
WMHTTPConnectionDTO | a_dto | The WMHTTPConnectionDTO to be updated. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
UpdateModel(WMPrincipal, DbContext, object[]?)
Updates and returns the contained model.
Declaration
public override Task<WMHTTPConnection> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
DbContext | context | |
object[] | data |
Returns
Type | Description |
---|---|
Task<WMHTTPConnection> |
Overrides
Versions(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Gets all versions of the specified asset.
Declaration
public static Task<IEnumerable<VersionArgs>> Versions(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<IEnumerable<VersionArgs>> |
Exceptions
Type | Condition |
---|---|
Exception |