This commit is contained in:
Denis Makogon
2018-01-23 23:15:11 +02:00
committed by Reed Allman
parent 5fc01d6974
commit a70c038760
496 changed files with 7703 additions and 5030 deletions

View File

@@ -1,3 +1,10 @@
Release v1.12.67 (2018-01-22)
===
### Service Client Updates
* `service/budgets`: Updates service API and documentation
* Add additional costTypes: IncludeDiscount, UseAmortized, to support finer control for different charges included in a cost budget.
Release v1.12.66 (2018-01-19)
===

View File

@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.12.66"
const SDKVersion = "1.12.67"

View File

@@ -283,7 +283,9 @@
"IncludeUpfront":{"shape":"NullableBoolean"},
"IncludeRecurring":{"shape":"NullableBoolean"},
"IncludeOtherSubscription":{"shape":"NullableBoolean"},
"IncludeSupport":{"shape":"NullableBoolean"}
"IncludeSupport":{"shape":"NullableBoolean"},
"IncludeDiscount":{"shape":"NullableBoolean"},
"UseAmortized":{"shape":"NullableBoolean"}
}
},
"CreateBudgetRequest":{

View File

@@ -321,7 +321,9 @@
"CostTypes$IncludeUpfront": "A boolean value whether to include upfront costs in the cost budget.",
"CostTypes$IncludeRecurring": "A boolean value whether to include recurring costs in the cost budget.",
"CostTypes$IncludeOtherSubscription": "A boolean value whether to include other subscription costs in the cost budget.",
"CostTypes$IncludeSupport": "A boolean value whether to include support costs in the cost budget."
"CostTypes$IncludeSupport": "A boolean value whether to include support costs in the cost budget.",
"CostTypes$IncludeDiscount": "A boolean value whether to include discounts in the cost budget.",
"CostTypes$UseAmortized": "A boolean value whether to include amortized costs in the cost budget."
}
},
"NumericValue": {

View File

@@ -1357,6 +1357,9 @@ type CostTypes struct {
// A boolean value whether to include credits in the cost budget.
IncludeCredit *bool `type:"boolean"`
// A boolean value whether to include discounts in the cost budget.
IncludeDiscount *bool `type:"boolean"`
// A boolean value whether to include other subscription costs in the cost budget.
IncludeOtherSubscription *bool `type:"boolean"`
@@ -1378,6 +1381,9 @@ type CostTypes struct {
// A boolean value whether to include upfront costs in the cost budget.
IncludeUpfront *bool `type:"boolean"`
// A boolean value whether to include amortized costs in the cost budget.
UseAmortized *bool `type:"boolean"`
// A boolean value whether to use blended costs in the cost budget.
UseBlended *bool `type:"boolean"`
}
@@ -1398,6 +1404,12 @@ func (s *CostTypes) SetIncludeCredit(v bool) *CostTypes {
return s
}
// SetIncludeDiscount sets the IncludeDiscount field's value.
func (s *CostTypes) SetIncludeDiscount(v bool) *CostTypes {
s.IncludeDiscount = &v
return s
}
// SetIncludeOtherSubscription sets the IncludeOtherSubscription field's value.
func (s *CostTypes) SetIncludeOtherSubscription(v bool) *CostTypes {
s.IncludeOtherSubscription = &v
@@ -1440,6 +1452,12 @@ func (s *CostTypes) SetIncludeUpfront(v bool) *CostTypes {
return s
}
// SetUseAmortized sets the UseAmortized field's value.
func (s *CostTypes) SetUseAmortized(v bool) *CostTypes {
s.UseAmortized = &v
return s
}
// SetUseBlended sets the UseBlended field's value.
func (s *CostTypes) SetUseBlended(v bool) *CostTypes {
s.UseBlended = &v

View File

@@ -63,9 +63,12 @@ func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error
input.Metadata[http.CanonicalHeaderKey(matDescHeader)] = &env.MatDesc
input.Metadata[http.CanonicalHeaderKey(wrapAlgorithmHeader)] = &env.WrapAlg
input.Metadata[http.CanonicalHeaderKey(cekAlgorithmHeader)] = &env.CEKAlg
input.Metadata[http.CanonicalHeaderKey(tagLengthHeader)] = &env.TagLen
input.Metadata[http.CanonicalHeaderKey(unencryptedMD5Header)] = &env.UnencryptedMD5
input.Metadata[http.CanonicalHeaderKey(unencryptedContentLengthHeader)] = &env.UnencryptedContentLen
if len(env.TagLen) > 0 {
input.Metadata[http.CanonicalHeaderKey(tagLengthHeader)] = &env.TagLen
}
return nil
}

View File

@@ -11,38 +11,67 @@ import (
)
func TestHeaderV2SaveStrategy(t *testing.T) {
env := s3crypto.Envelope{
CipherKey: "Foo",
IV: "Bar",
MatDesc: "{}",
WrapAlg: s3crypto.KMSWrap,
CEKAlg: s3crypto.AESGCMNoPadding,
TagLen: "128",
UnencryptedMD5: "hello",
UnencryptedContentLen: "0",
}
params := &s3.PutObjectInput{}
req := &request.Request{
Params: params,
}
strat := s3crypto.HeaderV2SaveStrategy{}
err := strat.Save(env, req)
if err != nil {
t.Errorf("expected no error, but received %v", err)
cases := []struct {
env s3crypto.Envelope
expected map[string]*string
}{
{
s3crypto.Envelope{
CipherKey: "Foo",
IV: "Bar",
MatDesc: "{}",
WrapAlg: s3crypto.KMSWrap,
CEKAlg: s3crypto.AESGCMNoPadding,
TagLen: "128",
UnencryptedMD5: "hello",
UnencryptedContentLen: "0",
},
map[string]*string{
"X-Amz-Key-V2": aws.String("Foo"),
"X-Amz-Iv": aws.String("Bar"),
"X-Amz-Matdesc": aws.String("{}"),
"X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap),
"X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding),
"X-Amz-Tag-Len": aws.String("128"),
"X-Amz-Unencrypted-Content-Md5": aws.String("hello"),
"X-Amz-Unencrypted-Content-Length": aws.String("0"),
},
},
{
s3crypto.Envelope{
CipherKey: "Foo",
IV: "Bar",
MatDesc: "{}",
WrapAlg: s3crypto.KMSWrap,
CEKAlg: s3crypto.AESGCMNoPadding,
UnencryptedMD5: "hello",
UnencryptedContentLen: "0",
},
map[string]*string{
"X-Amz-Key-V2": aws.String("Foo"),
"X-Amz-Iv": aws.String("Bar"),
"X-Amz-Matdesc": aws.String("{}"),
"X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap),
"X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding),
"X-Amz-Unencrypted-Content-Md5": aws.String("hello"),
"X-Amz-Unencrypted-Content-Length": aws.String("0"),
},
},
}
expected := map[string]*string{
"X-Amz-Key-V2": aws.String("Foo"),
"X-Amz-Iv": aws.String("Bar"),
"X-Amz-Matdesc": aws.String("{}"),
"X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap),
"X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding),
"X-Amz-Tag-Len": aws.String("128"),
"X-Amz-Unencrypted-Content-Md5": aws.String("hello"),
"X-Amz-Unencrypted-Content-Length": aws.String("0"),
}
for _, c := range cases {
params := &s3.PutObjectInput{}
req := &request.Request{
Params: params,
}
strat := s3crypto.HeaderV2SaveStrategy{}
err := strat.Save(c.env, req)
if err != nil {
t.Errorf("expected no error, but received %v", err)
}
if !reflect.DeepEqual(expected, params.Metadata) {
t.Errorf("expected %v, but received %v", expected, params.Metadata)
if !reflect.DeepEqual(c.expected, params.Metadata) {
t.Errorf("expected %v, but received %v", c.expected, params.Metadata)
}
}
}