Struct: query.Map

import "../ibm-cos-sdk-go-v2/aws/protocol/query"

Overview

Map represents the encoding of Query maps. A Query map is a representation of a mapping of arbitrary string keys to arbitrary values of a fixed type. A Map differs from an Object in that the set of keys is not fixed, in that the values must all be of the same type, and that map entries are ordered. A serialized map might look like the following:

MapName.entry.1.key=Foo &MapName.entry.1.value=spam &MapName.entry.2.key=Bar &MapName.entry.2.value=eggs

Implemented Interfaces

types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, types.MetricsFilter, s3.PresignPost, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream

Method Summary collapse

Method Details

func (m *Map) Key(name string) Value

Key adds the given named key to the Query map. Returns a Value encoder that should be used to encode a Query value type.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// File 'aws/protocol/query/map.go', line 59

func (m *Map) Key(name string) Value { // Query lists start a 1, so adjust the size first m.size++ var key string var value string if m.flat { key = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.keyLocationName) value = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.valueLocationName) } else { key = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.keyLocationName) value = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.valueLocationName) } // The key can only be a string, so we just go ahead and set it here newValue(m.values, key, false).String(name) // Maps can't have flat members return newValue(m.values, value, false) }