github.com/aldelo/common@v1.5.1/wrapper/sns/snsgettopicattribute/snsgettopicattribute_enumer.go (about)

     1  // Code Generated By gen-enumer For "Enum Type: SNSGetTopicAttribute" - DO NOT EDIT;
     2  
     3  /*
     4   * Copyright 2020-2023 Aldelo, LP
     5   *
     6   * Licensed under the Apache License, Version 2.0 (the "License");
     7   * you may not use this file except in compliance with the License.
     8   * You may obtain a copy of the License at
     9   *
    10   *     http://www.apache.org/licenses/LICENSE-2.0
    11   *
    12   * Unless required by applicable law or agreed to in writing, software
    13   * distributed under the License is distributed on an "AS IS" BASIS,
    14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15   * See the License for the specific language governing permissions and
    16   * limitations under the License.
    17   */
    18  
    19  package snsgettopicattribute
    20  
    21  import (
    22  	"fmt"
    23  	"strconv"
    24  )
    25  
    26  // enum names constants
    27  const (
    28  	_SNSGetTopicAttributeName_0  = "UNKNOWN"
    29  	_SNSGetTopicAttributeName_1  = "DeliveryPolicy"
    30  	_SNSGetTopicAttributeName_2  = "DisplayName"
    31  	_SNSGetTopicAttributeName_3  = "Owner"
    32  	_SNSGetTopicAttributeName_4  = "Policy"
    33  	_SNSGetTopicAttributeName_5  = "SubscriptionsConfirmed"
    34  	_SNSGetTopicAttributeName_6  = "SubscriptionsDeleted"
    35  	_SNSGetTopicAttributeName_7  = "SubscriptionsPending"
    36  	_SNSGetTopicAttributeName_8  = "TopicArn"
    37  	_SNSGetTopicAttributeName_9  = "EffectiveDeliveryPolicy"
    38  	_SNSGetTopicAttributeName_10 = "KmsMasterKeyId"
    39  )
    40  
    41  // var declares of enum indexes
    42  var (
    43  	_SNSGetTopicAttributeIndex_0  = [...]uint8{0, 7}
    44  	_SNSGetTopicAttributeIndex_1  = [...]uint8{0, 14}
    45  	_SNSGetTopicAttributeIndex_2  = [...]uint8{0, 11}
    46  	_SNSGetTopicAttributeIndex_3  = [...]uint8{0, 5}
    47  	_SNSGetTopicAttributeIndex_4  = [...]uint8{0, 6}
    48  	_SNSGetTopicAttributeIndex_5  = [...]uint8{0, 22}
    49  	_SNSGetTopicAttributeIndex_6  = [...]uint8{0, 20}
    50  	_SNSGetTopicAttributeIndex_7  = [...]uint8{0, 20}
    51  	_SNSGetTopicAttributeIndex_8  = [...]uint8{0, 8}
    52  	_SNSGetTopicAttributeIndex_9  = [...]uint8{0, 23}
    53  	_SNSGetTopicAttributeIndex_10 = [...]uint8{0, 14}
    54  )
    55  
    56  func (i SNSGetTopicAttribute) String() string {
    57  	switch {
    58  	case i == UNKNOWN:
    59  		return _SNSGetTopicAttributeName_0
    60  	case i == DeliveryPolicy:
    61  		return _SNSGetTopicAttributeName_1
    62  	case i == DisplayName:
    63  		return _SNSGetTopicAttributeName_2
    64  	case i == Owner:
    65  		return _SNSGetTopicAttributeName_3
    66  	case i == Policy:
    67  		return _SNSGetTopicAttributeName_4
    68  	case i == SubscriptionsConfirmed:
    69  		return _SNSGetTopicAttributeName_5
    70  	case i == SubscriptionsDeleted:
    71  		return _SNSGetTopicAttributeName_6
    72  	case i == SubscriptionsPending:
    73  		return _SNSGetTopicAttributeName_7
    74  	case i == TopicArn:
    75  		return _SNSGetTopicAttributeName_8
    76  	case i == EffectiveDeliveryPolicy:
    77  		return _SNSGetTopicAttributeName_9
    78  	case i == KmsMasterKeyId:
    79  		return _SNSGetTopicAttributeName_10
    80  	default:
    81  		return ""
    82  	}
    83  }
    84  
    85  var _SNSGetTopicAttributeValues = []SNSGetTopicAttribute{
    86  	0,  // UNKNOWN
    87  	1,  // DeliveryPolicy
    88  	2,  // DisplayName
    89  	3,  // Owner
    90  	4,  // Policy
    91  	5,  // SubscriptionsConfirmed
    92  	6,  // SubscriptionsDeleted
    93  	7,  // SubscriptionsPending
    94  	8,  // TopicArn
    95  	9,  // EffectiveDeliveryPolicy
    96  	10, // KmsMasterKeyId
    97  }
    98  
    99  var _SNSGetTopicAttributeNameToValueMap = map[string]SNSGetTopicAttribute{
   100  	_SNSGetTopicAttributeName_0[0:7]:   0,  // UNKNOWN
   101  	_SNSGetTopicAttributeName_1[0:14]:  1,  // DeliveryPolicy
   102  	_SNSGetTopicAttributeName_2[0:11]:  2,  // DisplayName
   103  	_SNSGetTopicAttributeName_3[0:5]:   3,  // Owner
   104  	_SNSGetTopicAttributeName_4[0:6]:   4,  // Policy
   105  	_SNSGetTopicAttributeName_5[0:22]:  5,  // SubscriptionsConfirmed
   106  	_SNSGetTopicAttributeName_6[0:20]:  6,  // SubscriptionsDeleted
   107  	_SNSGetTopicAttributeName_7[0:20]:  7,  // SubscriptionsPending
   108  	_SNSGetTopicAttributeName_8[0:8]:   8,  // TopicArn
   109  	_SNSGetTopicAttributeName_9[0:23]:  9,  // EffectiveDeliveryPolicy
   110  	_SNSGetTopicAttributeName_10[0:14]: 10, // KmsMasterKeyId
   111  }
   112  
   113  var _SNSGetTopicAttributeValueToKeyMap = map[SNSGetTopicAttribute]string{
   114  	0:  _SNSGetTopicAttributeKey_0,  // UNKNOWN
   115  	1:  _SNSGetTopicAttributeKey_1,  // DeliveryPolicy
   116  	2:  _SNSGetTopicAttributeKey_2,  // DisplayName
   117  	3:  _SNSGetTopicAttributeKey_3,  // Owner
   118  	4:  _SNSGetTopicAttributeKey_4,  // Policy
   119  	5:  _SNSGetTopicAttributeKey_5,  // SubscriptionsConfirmed
   120  	6:  _SNSGetTopicAttributeKey_6,  // SubscriptionsDeleted
   121  	7:  _SNSGetTopicAttributeKey_7,  // SubscriptionsPending
   122  	8:  _SNSGetTopicAttributeKey_8,  // TopicArn
   123  	9:  _SNSGetTopicAttributeKey_9,  // EffectiveDeliveryPolicy
   124  	10: _SNSGetTopicAttributeKey_10, // KmsMasterKeyId
   125  }
   126  
   127  var _SNSGetTopicAttributeValueToCaptionMap = map[SNSGetTopicAttribute]string{
   128  	0:  _SNSGetTopicAttributeCaption_0,  // UNKNOWN
   129  	1:  _SNSGetTopicAttributeCaption_1,  // DeliveryPolicy
   130  	2:  _SNSGetTopicAttributeCaption_2,  // DisplayName
   131  	3:  _SNSGetTopicAttributeCaption_3,  // Owner
   132  	4:  _SNSGetTopicAttributeCaption_4,  // Policy
   133  	5:  _SNSGetTopicAttributeCaption_5,  // SubscriptionsConfirmed
   134  	6:  _SNSGetTopicAttributeCaption_6,  // SubscriptionsDeleted
   135  	7:  _SNSGetTopicAttributeCaption_7,  // SubscriptionsPending
   136  	8:  _SNSGetTopicAttributeCaption_8,  // TopicArn
   137  	9:  _SNSGetTopicAttributeCaption_9,  // EffectiveDeliveryPolicy
   138  	10: _SNSGetTopicAttributeCaption_10, // KmsMasterKeyId
   139  }
   140  
   141  var _SNSGetTopicAttributeValueToDescriptionMap = map[SNSGetTopicAttribute]string{
   142  	0:  _SNSGetTopicAttributeDescription_0,  // UNKNOWN
   143  	1:  _SNSGetTopicAttributeDescription_1,  // DeliveryPolicy
   144  	2:  _SNSGetTopicAttributeDescription_2,  // DisplayName
   145  	3:  _SNSGetTopicAttributeDescription_3,  // Owner
   146  	4:  _SNSGetTopicAttributeDescription_4,  // Policy
   147  	5:  _SNSGetTopicAttributeDescription_5,  // SubscriptionsConfirmed
   148  	6:  _SNSGetTopicAttributeDescription_6,  // SubscriptionsDeleted
   149  	7:  _SNSGetTopicAttributeDescription_7,  // SubscriptionsPending
   150  	8:  _SNSGetTopicAttributeDescription_8,  // TopicArn
   151  	9:  _SNSGetTopicAttributeDescription_9,  // EffectiveDeliveryPolicy
   152  	10: _SNSGetTopicAttributeDescription_10, // KmsMasterKeyId
   153  }
   154  
   155  // Valid returns 'true' if the value is listed in the SNSGetTopicAttribute enum map definition, 'false' otherwise
   156  func (i SNSGetTopicAttribute) Valid() bool {
   157  	for _, v := range _SNSGetTopicAttributeValues {
   158  		if i == v {
   159  			return true
   160  		}
   161  	}
   162  
   163  	return false
   164  }
   165  
   166  // ParseByName retrieves a SNSGetTopicAttribute enum value from the enum string name,
   167  // throws an error if the param is not part of the enum
   168  func (i SNSGetTopicAttribute) ParseByName(s string) (SNSGetTopicAttribute, error) {
   169  	if val, ok := _SNSGetTopicAttributeNameToValueMap[s]; ok {
   170  		// parse ok
   171  		return val, nil
   172  	}
   173  
   174  	// error
   175  	return -1, fmt.Errorf("Enum Name of %s Not Expected In SNSGetTopicAttribute Values List", s)
   176  }
   177  
   178  // ParseByKey retrieves a SNSGetTopicAttribute enum value from the enum string key,
   179  // throws an error if the param is not part of the enum
   180  func (i SNSGetTopicAttribute) ParseByKey(s string) (SNSGetTopicAttribute, error) {
   181  	for k, v := range _SNSGetTopicAttributeValueToKeyMap {
   182  		if v == s {
   183  			// parse ok
   184  			return k, nil
   185  		}
   186  	}
   187  
   188  	// error
   189  	return -1, fmt.Errorf("Enum Key of %s Not Expected In SNSGetTopicAttribute Keys List", s)
   190  }
   191  
   192  // Key retrieves a SNSGetTopicAttribute enum string key
   193  func (i SNSGetTopicAttribute) Key() string {
   194  	if val, ok := _SNSGetTopicAttributeValueToKeyMap[i]; ok {
   195  		// found
   196  		return val
   197  	} else {
   198  		// not found
   199  		return ""
   200  	}
   201  }
   202  
   203  // Caption retrieves a SNSGetTopicAttribute enum string caption
   204  func (i SNSGetTopicAttribute) Caption() string {
   205  	if val, ok := _SNSGetTopicAttributeValueToCaptionMap[i]; ok {
   206  		// found
   207  		return val
   208  	} else {
   209  		// not found
   210  		return ""
   211  	}
   212  }
   213  
   214  // Description retrieves a SNSGetTopicAttribute enum string description
   215  func (i SNSGetTopicAttribute) Description() string {
   216  	if val, ok := _SNSGetTopicAttributeValueToDescriptionMap[i]; ok {
   217  		// found
   218  		return val
   219  	} else {
   220  		// not found
   221  		return ""
   222  	}
   223  }
   224  
   225  // IntValue gets the intrinsic enum integer value
   226  func (i SNSGetTopicAttribute) IntValue() int {
   227  	return int(i)
   228  }
   229  
   230  // IntString gets the intrinsic enum integer value represented in string format
   231  func (i SNSGetTopicAttribute) IntString() string {
   232  	return strconv.Itoa(int(i))
   233  }
   234  
   235  // ValueSlice returns all values of the enum SNSGetTopicAttribute in a slice
   236  func (i SNSGetTopicAttribute) ValueSlice() []SNSGetTopicAttribute {
   237  	return _SNSGetTopicAttributeValues
   238  }
   239  
   240  // NameMap returns all names of the enum SNSGetTopicAttribute in a K:name,V:SNSGetTopicAttribute map
   241  func (i SNSGetTopicAttribute) NameMap() map[string]SNSGetTopicAttribute {
   242  	return _SNSGetTopicAttributeNameToValueMap
   243  }
   244  
   245  // KeyMap returns all keys of the enum SNSGetTopicAttribute in a K:SNSGetTopicAttribute,V:key map
   246  func (i SNSGetTopicAttribute) KeyMap() map[SNSGetTopicAttribute]string {
   247  	return _SNSGetTopicAttributeValueToKeyMap
   248  }
   249  
   250  // CaptionMap returns all captions of the enum SNSGetTopicAttribute in a K:SNSGetTopicAttribute,V:caption map
   251  func (i SNSGetTopicAttribute) CaptionMap() map[SNSGetTopicAttribute]string {
   252  	return _SNSGetTopicAttributeValueToCaptionMap
   253  }
   254  
   255  // DescriptionMap returns all descriptions of the enum SNSGetTopicAttribute in a K:SNSGetTopicAttribute,V:description map
   256  func (i SNSGetTopicAttribute) DescriptionMap() map[SNSGetTopicAttribute]string {
   257  	return _SNSGetTopicAttributeValueToDescriptionMap
   258  }