public RequestTypeGeneratorFactory(GenerationContext context, IMediaTypeSelector mediaTypeSelector,
                                    IBuildRequestMethodGenerator buildRequestMethodGenerator, IBuildUriMethodGenerator buildUriMethodGenerator,
                                    IAddHeadersMethodGenerator addHeadersMethodGenerator, IBuildContentMethodGenerator buildContentMethodGenerator,
                                    IRequestsNamespace requestsNamespace)
 {
     _context                     = context ?? throw new ArgumentNullException(nameof(context));
     _mediaTypeSelector           = mediaTypeSelector ?? throw new ArgumentNullException(nameof(mediaTypeSelector));
     _buildRequestMethodGenerator = buildRequestMethodGenerator ??
                                    throw new ArgumentNullException(nameof(buildRequestMethodGenerator));
     _buildUriMethodGenerator = buildUriMethodGenerator ??
                                throw new ArgumentNullException(nameof(buildUriMethodGenerator));
     _addHeadersMethodGenerator = addHeadersMethodGenerator ??
                                  throw new ArgumentNullException(nameof(addHeadersMethodGenerator));
     _buildContentMethodGenerator = buildContentMethodGenerator ??
                                    throw new ArgumentNullException(nameof(buildContentMethodGenerator));
     _requestsNamespace = requestsNamespace ?? throw new ArgumentNullException(nameof(requestsNamespace));
 }
Exemple #2
0
 public RequestTypeGenerator(ILocatedOpenApiElement <OpenApiOperation> operationElement,
                             GenerationContext context, IMediaTypeSelector mediaTypeSelector,
                             IBuildRequestMethodGenerator buildRequestMethodGenerator, IBuildUriMethodGenerator buildUriMethodGenerator,
                             IAddHeadersMethodGenerator addHeadersMethodGenerator, IBuildContentMethodGenerator buildContentMethodGenerator,
                             IRequestsNamespace requestsNamespace)
     : base(operationElement, context)
 {
     MediaTypeSelector           = mediaTypeSelector ?? throw new ArgumentNullException(nameof(mediaTypeSelector));
     BuildRequestMethodGenerator = buildRequestMethodGenerator ?? throw new ArgumentNullException(nameof(buildRequestMethodGenerator));
     BuildUriMethodGenerator     = buildUriMethodGenerator ??
                                   throw new ArgumentNullException(nameof(buildUriMethodGenerator));
     AddHeadersMethodGenerator = addHeadersMethodGenerator ??
                                 throw new ArgumentNullException(nameof(addHeadersMethodGenerator));
     BuildContentMethodGenerator = buildContentMethodGenerator ??
                                   throw new ArgumentNullException(nameof(buildContentMethodGenerator));
     RequestsNamespace = requestsNamespace ?? throw new ArgumentNullException(nameof(requestsNamespace));
 }