Add array-valued output properties to RestAPI
These properties no longer trigger assertons after work on #198.
This commit is contained in:
parent
09f2968d18
commit
658d4b3c8a
4 changed files with 15 additions and 17 deletions
|
@ -48,15 +48,11 @@ type RestAPI struct {
|
|||
CreatedDate string `lumi:"createdDate,out"`
|
||||
// A version identifier for the API.
|
||||
Version string `lumi:"version,out"`
|
||||
|
||||
// TODO[pulumi/lumi#198] Exposing array-valued output properties
|
||||
// currently triggers failures serializing resource state, so
|
||||
// supressing these properties.
|
||||
// The warning messages reported when failonwarnings is turned on during API import.
|
||||
//Warnings []string `lumi:"warnings,out"`
|
||||
Warnings []string `lumi:"warnings,out"`
|
||||
// The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded
|
||||
// text payloads.
|
||||
//BinaryMediaTypes []string `lumi:"binaryMediaTypes,out"`
|
||||
BinaryMediaTypes []string `lumi:"binaryMediaTypes,out"`
|
||||
}
|
||||
|
||||
// S3Location is a property of the RestAPI resource that specifies the Amazon Simple Storage Service (Amazon S3)
|
||||
|
|
|
@ -17,6 +17,8 @@ export class RestAPI extends lumi.Resource implements RestAPIArgs {
|
|||
public id: string;
|
||||
public createdDate: string;
|
||||
public version: string;
|
||||
public warnings: string[];
|
||||
public binaryMediaTypes: string[];
|
||||
|
||||
constructor(name: string, args?: RestAPIArgs) {
|
||||
super();
|
||||
|
|
|
@ -122,17 +122,13 @@ func (p *restAPIProvider) Get(ctx context.Context, id resource.ID) (*apigateway.
|
|||
}
|
||||
|
||||
return &apigateway.RestAPI{
|
||||
ID: aws.StringValue(resp.Id),
|
||||
APIName: resp.Name,
|
||||
Description: resp.Description,
|
||||
CreatedDate: resp.CreatedDate.String(),
|
||||
Version: aws.StringValue(resp.Version),
|
||||
|
||||
// TODO[pulumi/lumi#198] Exposing array-valued output properties
|
||||
// currently triggers failures serializing resource state, so
|
||||
// supressing these properties.
|
||||
// Warnings: aws.StringValueSlice(resp.Warnings),
|
||||
// BinaryMediaTypes: aws.StringValueSlice(resp.BinaryMediaTypes),
|
||||
ID: aws.StringValue(resp.Id),
|
||||
APIName: resp.Name,
|
||||
Description: resp.Description,
|
||||
CreatedDate: resp.CreatedDate.String(),
|
||||
Version: aws.StringValue(resp.Version),
|
||||
Warnings: aws.StringValueSlice(resp.Warnings),
|
||||
BinaryMediaTypes: aws.StringValueSlice(resp.BinaryMediaTypes),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,8 @@ type RestAPI struct {
|
|||
ID string `json:"id,omitempty"`
|
||||
CreatedDate string `json:"createdDate,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Warnings []string `json:"warnings,omitempty"`
|
||||
BinaryMediaTypes []string `json:"binaryMediaTypes,omitempty"`
|
||||
}
|
||||
|
||||
// RestAPI's properties have constants to make dealing with diffs and property bags easier.
|
||||
|
@ -200,6 +202,8 @@ const (
|
|||
RestAPI_ID = "id"
|
||||
RestAPI_CreatedDate = "createdDate"
|
||||
RestAPI_Version = "version"
|
||||
RestAPI_Warnings = "warnings"
|
||||
RestAPI_BinaryMediaTypes = "binaryMediaTypes"
|
||||
)
|
||||
|
||||
/* Marshalable S3Location structure(s) */
|
||||
|
|
Loading…
Reference in a new issue