properties.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package http
  2. import smithy "github.com/aws/smithy-go"
  3. type (
  4. sigV4SigningNameKey struct{}
  5. sigV4SigningRegionKey struct{}
  6. sigV4ASigningNameKey struct{}
  7. sigV4ASigningRegionsKey struct{}
  8. isUnsignedPayloadKey struct{}
  9. disableDoubleEncodingKey struct{}
  10. )
  11. // GetSigV4SigningName gets the signing name from Properties.
  12. func GetSigV4SigningName(p *smithy.Properties) (string, bool) {
  13. v, ok := p.Get(sigV4SigningNameKey{}).(string)
  14. return v, ok
  15. }
  16. // SetSigV4SigningName sets the signing name on Properties.
  17. func SetSigV4SigningName(p *smithy.Properties, name string) {
  18. p.Set(sigV4SigningNameKey{}, name)
  19. }
  20. // GetSigV4SigningRegion gets the signing region from Properties.
  21. func GetSigV4SigningRegion(p *smithy.Properties) (string, bool) {
  22. v, ok := p.Get(sigV4SigningRegionKey{}).(string)
  23. return v, ok
  24. }
  25. // SetSigV4SigningRegion sets the signing region on Properties.
  26. func SetSigV4SigningRegion(p *smithy.Properties, region string) {
  27. p.Set(sigV4SigningRegionKey{}, region)
  28. }
  29. // GetSigV4ASigningName gets the v4a signing name from Properties.
  30. func GetSigV4ASigningName(p *smithy.Properties) (string, bool) {
  31. v, ok := p.Get(sigV4ASigningNameKey{}).(string)
  32. return v, ok
  33. }
  34. // SetSigV4ASigningName sets the signing name on Properties.
  35. func SetSigV4ASigningName(p *smithy.Properties, name string) {
  36. p.Set(sigV4ASigningNameKey{}, name)
  37. }
  38. // GetSigV4ASigningRegion gets the v4a signing region set from Properties.
  39. func GetSigV4ASigningRegions(p *smithy.Properties) ([]string, bool) {
  40. v, ok := p.Get(sigV4ASigningRegionsKey{}).([]string)
  41. return v, ok
  42. }
  43. // SetSigV4ASigningRegions sets the v4a signing region set on Properties.
  44. func SetSigV4ASigningRegions(p *smithy.Properties, regions []string) {
  45. p.Set(sigV4ASigningRegionsKey{}, regions)
  46. }
  47. // GetIsUnsignedPayload gets whether the payload is unsigned from Properties.
  48. func GetIsUnsignedPayload(p *smithy.Properties) (bool, bool) {
  49. v, ok := p.Get(isUnsignedPayloadKey{}).(bool)
  50. return v, ok
  51. }
  52. // SetIsUnsignedPayload sets whether the payload is unsigned on Properties.
  53. func SetIsUnsignedPayload(p *smithy.Properties, isUnsignedPayload bool) {
  54. p.Set(isUnsignedPayloadKey{}, isUnsignedPayload)
  55. }
  56. // GetDisableDoubleEncoding gets whether the payload is unsigned from Properties.
  57. func GetDisableDoubleEncoding(p *smithy.Properties) (bool, bool) {
  58. v, ok := p.Get(disableDoubleEncodingKey{}).(bool)
  59. return v, ok
  60. }
  61. // SetDisableDoubleEncoding sets whether the payload is unsigned on Properties.
  62. func SetDisableDoubleEncoding(p *smithy.Properties, disableDoubleEncoding bool) {
  63. p.Set(disableDoubleEncodingKey{}, disableDoubleEncoding)
  64. }