github.com/aldelo/common@v1.5.1/wrapper/sns/snsplatformapplicationattribute/snsplatformapplicationattribute_enumer.go (about)

     1  // Code Generated By gen-enumer For "Enum Type: SNSPlatformApplicationAttribute" - 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 snsplatformapplicationattribute
    20  
    21  import (
    22  	"fmt"
    23  	"strconv"
    24  )
    25  
    26  // enum names constants
    27  const (
    28  	_SNSPlatformApplicationAttributeName_0 = "UNKNOWN"
    29  	_SNSPlatformApplicationAttributeName_1 = "PlatformCredential"
    30  	_SNSPlatformApplicationAttributeName_2 = "PlatformPrincipal"
    31  	_SNSPlatformApplicationAttributeName_3 = "EventEndpointCreated"
    32  	_SNSPlatformApplicationAttributeName_4 = "EventEndpointDeleted"
    33  	_SNSPlatformApplicationAttributeName_5 = "EventEndpointUpdated"
    34  	_SNSPlatformApplicationAttributeName_6 = "EventDeliveryFailure"
    35  	_SNSPlatformApplicationAttributeName_7 = "SuccessFeedbackRoleArn"
    36  	_SNSPlatformApplicationAttributeName_8 = "FailureFeedbackRoleArn"
    37  	_SNSPlatformApplicationAttributeName_9 = "SuccessFeedbackSampleRate"
    38  )
    39  
    40  // var declares of enum indexes
    41  var (
    42  	_SNSPlatformApplicationAttributeIndex_0 = [...]uint8{0, 7}
    43  	_SNSPlatformApplicationAttributeIndex_1 = [...]uint8{0, 18}
    44  	_SNSPlatformApplicationAttributeIndex_2 = [...]uint8{0, 17}
    45  	_SNSPlatformApplicationAttributeIndex_3 = [...]uint8{0, 20}
    46  	_SNSPlatformApplicationAttributeIndex_4 = [...]uint8{0, 20}
    47  	_SNSPlatformApplicationAttributeIndex_5 = [...]uint8{0, 20}
    48  	_SNSPlatformApplicationAttributeIndex_6 = [...]uint8{0, 20}
    49  	_SNSPlatformApplicationAttributeIndex_7 = [...]uint8{0, 22}
    50  	_SNSPlatformApplicationAttributeIndex_8 = [...]uint8{0, 22}
    51  	_SNSPlatformApplicationAttributeIndex_9 = [...]uint8{0, 25}
    52  )
    53  
    54  func (i SNSPlatformApplicationAttribute) String() string {
    55  	switch {
    56  	case i == UNKNOWN:
    57  		return _SNSPlatformApplicationAttributeName_0
    58  	case i == PlatformCredential:
    59  		return _SNSPlatformApplicationAttributeName_1
    60  	case i == PlatformPrincipal:
    61  		return _SNSPlatformApplicationAttributeName_2
    62  	case i == EventEndpointCreated:
    63  		return _SNSPlatformApplicationAttributeName_3
    64  	case i == EventEndpointDeleted:
    65  		return _SNSPlatformApplicationAttributeName_4
    66  	case i == EventEndpointUpdated:
    67  		return _SNSPlatformApplicationAttributeName_5
    68  	case i == EventDeliveryFailure:
    69  		return _SNSPlatformApplicationAttributeName_6
    70  	case i == SuccessFeedbackRoleArn:
    71  		return _SNSPlatformApplicationAttributeName_7
    72  	case i == FailureFeedbackRoleArn:
    73  		return _SNSPlatformApplicationAttributeName_8
    74  	case i == SuccessFeedbackSampleRate:
    75  		return _SNSPlatformApplicationAttributeName_9
    76  	default:
    77  		return ""
    78  	}
    79  }
    80  
    81  var _SNSPlatformApplicationAttributeValues = []SNSPlatformApplicationAttribute{
    82  	0, // UNKNOWN
    83  	1, // PlatformCredential
    84  	2, // PlatformPrincipal
    85  	3, // EventEndpointCreated
    86  	4, // EventEndpointDeleted
    87  	5, // EventEndpointUpdated
    88  	6, // EventDeliveryFailure
    89  	7, // SuccessFeedbackRoleArn
    90  	8, // FailureFeedbackRoleArn
    91  	9, // SuccessFeedbackSampleRate
    92  }
    93  
    94  var _SNSPlatformApplicationAttributeNameToValueMap = map[string]SNSPlatformApplicationAttribute{
    95  	_SNSPlatformApplicationAttributeName_0[0:7]:  0, // UNKNOWN
    96  	_SNSPlatformApplicationAttributeName_1[0:18]: 1, // PlatformCredential
    97  	_SNSPlatformApplicationAttributeName_2[0:17]: 2, // PlatformPrincipal
    98  	_SNSPlatformApplicationAttributeName_3[0:20]: 3, // EventEndpointCreated
    99  	_SNSPlatformApplicationAttributeName_4[0:20]: 4, // EventEndpointDeleted
   100  	_SNSPlatformApplicationAttributeName_5[0:20]: 5, // EventEndpointUpdated
   101  	_SNSPlatformApplicationAttributeName_6[0:20]: 6, // EventDeliveryFailure
   102  	_SNSPlatformApplicationAttributeName_7[0:22]: 7, // SuccessFeedbackRoleArn
   103  	_SNSPlatformApplicationAttributeName_8[0:22]: 8, // FailureFeedbackRoleArn
   104  	_SNSPlatformApplicationAttributeName_9[0:25]: 9, // SuccessFeedbackSampleRate
   105  }
   106  
   107  var _SNSPlatformApplicationAttributeValueToKeyMap = map[SNSPlatformApplicationAttribute]string{
   108  	0: _SNSPlatformApplicationAttributeKey_0, // UNKNOWN
   109  	1: _SNSPlatformApplicationAttributeKey_1, // PlatformCredential
   110  	2: _SNSPlatformApplicationAttributeKey_2, // PlatformPrincipal
   111  	3: _SNSPlatformApplicationAttributeKey_3, // EventEndpointCreated
   112  	4: _SNSPlatformApplicationAttributeKey_4, // EventEndpointDeleted
   113  	5: _SNSPlatformApplicationAttributeKey_5, // EventEndpointUpdated
   114  	6: _SNSPlatformApplicationAttributeKey_6, // EventDeliveryFailure
   115  	7: _SNSPlatformApplicationAttributeKey_7, // SuccessFeedbackRoleArn
   116  	8: _SNSPlatformApplicationAttributeKey_8, // FailureFeedbackRoleArn
   117  	9: _SNSPlatformApplicationAttributeKey_9, // SuccessFeedbackSampleRate
   118  }
   119  
   120  var _SNSPlatformApplicationAttributeValueToCaptionMap = map[SNSPlatformApplicationAttribute]string{
   121  	0: _SNSPlatformApplicationAttributeCaption_0, // UNKNOWN
   122  	1: _SNSPlatformApplicationAttributeCaption_1, // PlatformCredential
   123  	2: _SNSPlatformApplicationAttributeCaption_2, // PlatformPrincipal
   124  	3: _SNSPlatformApplicationAttributeCaption_3, // EventEndpointCreated
   125  	4: _SNSPlatformApplicationAttributeCaption_4, // EventEndpointDeleted
   126  	5: _SNSPlatformApplicationAttributeCaption_5, // EventEndpointUpdated
   127  	6: _SNSPlatformApplicationAttributeCaption_6, // EventDeliveryFailure
   128  	7: _SNSPlatformApplicationAttributeCaption_7, // SuccessFeedbackRoleArn
   129  	8: _SNSPlatformApplicationAttributeCaption_8, // FailureFeedbackRoleArn
   130  	9: _SNSPlatformApplicationAttributeCaption_9, // SuccessFeedbackSampleRate
   131  }
   132  
   133  var _SNSPlatformApplicationAttributeValueToDescriptionMap = map[SNSPlatformApplicationAttribute]string{
   134  	0: _SNSPlatformApplicationAttributeDescription_0, // UNKNOWN
   135  	1: _SNSPlatformApplicationAttributeDescription_1, // PlatformCredential
   136  	2: _SNSPlatformApplicationAttributeDescription_2, // PlatformPrincipal
   137  	3: _SNSPlatformApplicationAttributeDescription_3, // EventEndpointCreated
   138  	4: _SNSPlatformApplicationAttributeDescription_4, // EventEndpointDeleted
   139  	5: _SNSPlatformApplicationAttributeDescription_5, // EventEndpointUpdated
   140  	6: _SNSPlatformApplicationAttributeDescription_6, // EventDeliveryFailure
   141  	7: _SNSPlatformApplicationAttributeDescription_7, // SuccessFeedbackRoleArn
   142  	8: _SNSPlatformApplicationAttributeDescription_8, // FailureFeedbackRoleArn
   143  	9: _SNSPlatformApplicationAttributeDescription_9, // SuccessFeedbackSampleRate
   144  }
   145  
   146  // Valid returns 'true' if the value is listed in the SNSPlatformApplicationAttribute enum map definition, 'false' otherwise
   147  func (i SNSPlatformApplicationAttribute) Valid() bool {
   148  	for _, v := range _SNSPlatformApplicationAttributeValues {
   149  		if i == v {
   150  			return true
   151  		}
   152  	}
   153  
   154  	return false
   155  }
   156  
   157  // ParseByName retrieves a SNSPlatformApplicationAttribute enum value from the enum string name,
   158  // throws an error if the param is not part of the enum
   159  func (i SNSPlatformApplicationAttribute) ParseByName(s string) (SNSPlatformApplicationAttribute, error) {
   160  	if val, ok := _SNSPlatformApplicationAttributeNameToValueMap[s]; ok {
   161  		// parse ok
   162  		return val, nil
   163  	}
   164  
   165  	// error
   166  	return -1, fmt.Errorf("Enum Name of %s Not Expected In SNSPlatformApplicationAttribute Values List", s)
   167  }
   168  
   169  // ParseByKey retrieves a SNSPlatformApplicationAttribute enum value from the enum string key,
   170  // throws an error if the param is not part of the enum
   171  func (i SNSPlatformApplicationAttribute) ParseByKey(s string) (SNSPlatformApplicationAttribute, error) {
   172  	for k, v := range _SNSPlatformApplicationAttributeValueToKeyMap {
   173  		if v == s {
   174  			// parse ok
   175  			return k, nil
   176  		}
   177  	}
   178  
   179  	// error
   180  	return -1, fmt.Errorf("Enum Key of %s Not Expected In SNSPlatformApplicationAttribute Keys List", s)
   181  }
   182  
   183  // Key retrieves a SNSPlatformApplicationAttribute enum string key
   184  func (i SNSPlatformApplicationAttribute) Key() string {
   185  	if val, ok := _SNSPlatformApplicationAttributeValueToKeyMap[i]; ok {
   186  		// found
   187  		return val
   188  	} else {
   189  		// not found
   190  		return ""
   191  	}
   192  }
   193  
   194  // Caption retrieves a SNSPlatformApplicationAttribute enum string caption
   195  func (i SNSPlatformApplicationAttribute) Caption() string {
   196  	if val, ok := _SNSPlatformApplicationAttributeValueToCaptionMap[i]; ok {
   197  		// found
   198  		return val
   199  	} else {
   200  		// not found
   201  		return ""
   202  	}
   203  }
   204  
   205  // Description retrieves a SNSPlatformApplicationAttribute enum string description
   206  func (i SNSPlatformApplicationAttribute) Description() string {
   207  	if val, ok := _SNSPlatformApplicationAttributeValueToDescriptionMap[i]; ok {
   208  		// found
   209  		return val
   210  	} else {
   211  		// not found
   212  		return ""
   213  	}
   214  }
   215  
   216  // IntValue gets the intrinsic enum integer value
   217  func (i SNSPlatformApplicationAttribute) IntValue() int {
   218  	return int(i)
   219  }
   220  
   221  // IntString gets the intrinsic enum integer value represented in string format
   222  func (i SNSPlatformApplicationAttribute) IntString() string {
   223  	return strconv.Itoa(int(i))
   224  }
   225  
   226  // ValueSlice returns all values of the enum SNSPlatformApplicationAttribute in a slice
   227  func (i SNSPlatformApplicationAttribute) ValueSlice() []SNSPlatformApplicationAttribute {
   228  	return _SNSPlatformApplicationAttributeValues
   229  }
   230  
   231  // NameMap returns all names of the enum SNSPlatformApplicationAttribute in a K:name,V:SNSPlatformApplicationAttribute map
   232  func (i SNSPlatformApplicationAttribute) NameMap() map[string]SNSPlatformApplicationAttribute {
   233  	return _SNSPlatformApplicationAttributeNameToValueMap
   234  }
   235  
   236  // KeyMap returns all keys of the enum SNSPlatformApplicationAttribute in a K:SNSPlatformApplicationAttribute,V:key map
   237  func (i SNSPlatformApplicationAttribute) KeyMap() map[SNSPlatformApplicationAttribute]string {
   238  	return _SNSPlatformApplicationAttributeValueToKeyMap
   239  }
   240  
   241  // CaptionMap returns all captions of the enum SNSPlatformApplicationAttribute in a K:SNSPlatformApplicationAttribute,V:caption map
   242  func (i SNSPlatformApplicationAttribute) CaptionMap() map[SNSPlatformApplicationAttribute]string {
   243  	return _SNSPlatformApplicationAttributeValueToCaptionMap
   244  }
   245  
   246  // DescriptionMap returns all descriptions of the enum SNSPlatformApplicationAttribute in a K:SNSPlatformApplicationAttribute,V:description map
   247  func (i SNSPlatformApplicationAttribute) DescriptionMap() map[SNSPlatformApplicationAttribute]string {
   248  	return _SNSPlatformApplicationAttributeValueToDescriptionMap
   249  }