Class ProxyResourceProps
Inheritance
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ProxyResourceProps : Object, IProxyResourceProps, IProxyResourceOptions, IResourceOptions
Syntax (vb)
Public Class ProxyResourceProps
Inherits Object
Implements IProxyResourceProps, IProxyResourceOptions, IResourceOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.APIGateway;
Authorizer authorizer;
Integration integration;
Model model;
RequestValidator requestValidator;
Resource resource;
var proxyResourceProps = new ProxyResourceProps {
Parent = resource,
// the properties below are optional
AnyMethod = false,
DefaultCorsPreflightOptions = new CorsOptions {
AllowOrigins = new [] { "allowOrigins" },
// the properties below are optional
AllowCredentials = false,
AllowHeaders = new [] { "allowHeaders" },
AllowMethods = new [] { "allowMethods" },
DisableCache = false,
ExposeHeaders = new [] { "exposeHeaders" },
MaxAge = Duration.Minutes(30),
StatusCode = 123
},
DefaultIntegration = integration,
DefaultMethodOptions = new MethodOptions {
ApiKeyRequired = false,
AuthorizationScopes = new [] { "authorizationScopes" },
AuthorizationType = AuthorizationType.NONE,
Authorizer = authorizer,
MethodResponses = new [] { new MethodResponse {
StatusCode = "statusCode",
// the properties below are optional
ResponseModels = new Dictionary<string, IModel> {
{ "responseModelsKey", model }
},
ResponseParameters = new Dictionary<string, boolean> {
{ "responseParametersKey", false }
}
} },
OperationName = "operationName",
RequestModels = new Dictionary<string, IModel> {
{ "requestModelsKey", model }
},
RequestParameters = new Dictionary<string, boolean> {
{ "requestParametersKey", false }
},
RequestValidator = requestValidator,
RequestValidatorOptions = new RequestValidatorOptions {
RequestValidatorName = "requestValidatorName",
ValidateRequestBody = false,
ValidateRequestParameters = false
}
}
};
Synopsis
Constructors
ProxyResourceProps() |
Properties
AnyMethod | Adds an "ANY" method to this resource. |
DefaultCorsPreflightOptions | Adds a CORS preflight OPTIONS method to this resource and all child resources. |
DefaultIntegration | An integration to use as a default for all methods created within this API unless an integration is specified. |
DefaultMethodOptions | Method options to use as a default for all methods created within this API unless custom options are specified. |
Parent | The parent resource of this resource. |
Constructors
ProxyResourceProps()
public ProxyResourceProps()
Properties
AnyMethod
Adds an "ANY" method to this resource.
public Nullable<bool> AnyMethod { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to false
, you will have to explicitly
add methods to this resource after it's created.
Default: true
DefaultCorsPreflightOptions
Adds a CORS preflight OPTIONS method to this resource and all child resources.
public ICorsOptions DefaultCorsPreflightOptions { get; set; }
Property Value
Remarks
You can add CORS at the resource-level using addCorsPreflight
.
Default: - CORS is disabled
DefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.
public Integration DefaultIntegration { get; set; }
Property Value
Remarks
Default: - Inherited from parent.
DefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.
public IMethodOptions DefaultMethodOptions { get; set; }
Property Value
Remarks
Default: - Inherited from parent.
Parent
The parent resource of this resource.
public IResource Parent { get; set; }
Property Value
Remarks
You can either pass another
Resource
object or a RestApi
object here.