/// <summary> /// Initializes a new instance of the <see cref="ContentResponseMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The factory with which to create <see cref="HalDocument"/> instances.</param> /// <param name="linkResolver">The link resolver to build the links collection.</param> /// <param name="contentStateMapper">The mapper for individual <see cref="ContentState"/> items.</param> public ContentStatesResponseMapper( IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver linkResolver, ContentStateResponseMapper contentStateMapper) { this.halDocumentFactory = halDocumentFactory; this.linkResolver = linkResolver; this.contentStateMapper = contentStateMapper; }
/// <summary> /// Creates an <see cref="OperationsStatusOpenApiService"/>. /// </summary> /// <param name="tenancyHelper">The tenant provider.</param> /// <param name="operationalStatusTasks">Underlying tasks.</param> /// <param name="linkResolver">The link resolver.</param> public OperationsStatusOpenApiService( IMarainServicesTenancy tenancyHelper, IOperationsStatusTasks operationalStatusTasks, IOpenApiWebLinkResolver linkResolver) { this.tenancyHelper = tenancyHelper ?? throw new ArgumentNullException(nameof(tenancyHelper)); this.tasks = operationalStatusTasks ?? throw new ArgumentNullException(nameof(operationalStatusTasks)); this.linkResolver = linkResolver ?? throw new ArgumentNullException(nameof(linkResolver)); }
/// <summary> /// Initializes a new instance of the <see cref="SmsTemplateMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The service provider to construct <see cref="HalDocument"/> instances.</param> /// <param name="openApiWebLinkResolver">The link resolver.</param> public SmsTemplateMapper( IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver openApiWebLinkResolver) { this.halDocumentFactory = halDocumentFactory ?? throw new ArgumentNullException(nameof(halDocumentFactory)); this.openApiWebLinkResolver = openApiWebLinkResolver ?? throw new ArgumentNullException(nameof(openApiWebLinkResolver)); }
/// <summary> /// Initializes a new instance of the <see cref="UserNotificationsMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The service provider to construct <see cref="HalDocument"/> instances.</param> /// <param name="openApiWebLinkResolver">The link resolver.</param> /// <param name="userNotificationMapper">The user notification mapper.</param> public UserNotificationsMapper( IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver openApiWebLinkResolver, UserNotificationMapper userNotificationMapper) { this.halDocumentFactory = halDocumentFactory ?? throw new ArgumentNullException(nameof(halDocumentFactory)); this.openApiWebLinkResolver = openApiWebLinkResolver ?? throw new ArgumentNullException(nameof(openApiWebLinkResolver)); this.userNotificationMapper = userNotificationMapper ?? throw new ArgumentNullException(nameof(userNotificationMapper)); }
/// <summary> /// Initializes a new instance of the <see cref="TenancyService"/> class. /// </summary> /// <param name="tenantStore">The tenant store.</param> /// <param name="propertyBagFactory">Provides property bag initialization and modification services.</param> /// <param name="tenantMapper">The mapper from tenants to tenant resources.</param> /// <param name="tenantCollectionResultMapper">The mapper from tenant collection results to the result resource.</param> /// <param name="linkResolver">The link resolver.</param> /// <param name="cacheConfiguration">Cache configuration.</param> /// <param name="logger">The logger for the service.</param> public TenancyService( ITenantStore tenantStore, IPropertyBagFactory propertyBagFactory, TenantMapper tenantMapper, TenantCollectionResultMapper tenantCollectionResultMapper, IOpenApiWebLinkResolver linkResolver, TenantCacheConfiguration cacheConfiguration, ILogger <TenancyService> logger) { this.tenantStore = tenantStore ?? throw new ArgumentNullException(nameof(tenantStore)); this.tenantMapper = tenantMapper ?? throw new ArgumentNullException(nameof(tenantMapper)); this.tenantCollectionResultMapper = tenantCollectionResultMapper ?? throw new ArgumentNullException(nameof(tenantCollectionResultMapper)); this.linkResolver = linkResolver ?? throw new ArgumentNullException(nameof(linkResolver)); this.cacheConfiguration = cacheConfiguration ?? throw new ArgumentNullException(nameof(cacheConfiguration)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.propertyBagFactory = propertyBagFactory; }
/// <summary> /// Initializes a new instance of the <see cref="TenantCollectionResultMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The service provider to construct <see cref="HalDocument"/> instances.</param> /// <param name="linkResolver">The link resolver to build the links collection.</param> public TenantCollectionResultMapper(IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver linkResolver) { this.halDocumentFactory = halDocumentFactory; this.linkResolver = linkResolver; }
/// <summary> /// Adds a new link resolved using the given resolver for the specified object and relation type. /// </summary> /// <param name="linkCollection">The <see cref="ILinkCollection"/> to add to.</param> /// <param name="linkResolver">The <see cref="IOpenApiWebLinkResolver"/> to use for resolving links.</param> /// <param name="owner">The owner of the link. An operation map for the owner and relation type must be defined on startup.</param> /// <param name="relationType">The link relation type.</param> /// <param name="parameters">Any parameters that will be required to build the link.</param> /// <returns>A new <see cref="WebLink"/> which has been added to the given link collection.</returns> public static OpenApiWebLink ResolveAndAddByOwnerAndRelationType( this ILinkCollection linkCollection, IOpenApiWebLinkResolver linkResolver, object owner, string relationType, params (string, object?)[] parameters)
/// <summary> /// Initializes a new instance of the <see cref="ContentSummaryResponseMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The factory with which to create <see cref="HalDocument"/> instances.</param> /// <param name="linkResolver">The link resolver to build the links collection.</param> public ContentSummaryResponseMapper(IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver linkResolver) { this.halDocumentFactory = halDocumentFactory; this.linkResolver = linkResolver; }
/// <summary> /// Initializes a new instance of the <see cref="PetListResourceMapper"/> class. /// </summary> /// <param name="halDocumentFactory">The factoryh with which to create <see cref="HalDocument"/> instances.</param> /// <param name="linkResolver">The link resolver to build the links collection.</param> /// <param name="petResourceMapper">The mapper for individual Pets.</param> public PetListResourceMapper(IHalDocumentFactory halDocumentFactory, IOpenApiWebLinkResolver linkResolver, PetResourceMapper petResourceMapper) { this.halDocumentFactory = halDocumentFactory; this.linkResolver = linkResolver; this.petResourceMapper = petResourceMapper; }