Repository: google/go-github
File: github/orgs_properties.go (Go)

Code before:
	ValuesEditableBy *string `json:"values_editable_by,omitempty"`
}

// DefaultValueString returns the DefaultValue as a string if the ValueType is string or single_select or url.
func (cp CustomProperty) DefaultValueString() (string, bool) {
	switch cp.ValueType {
	case PropertyValueTypeString, PropertyValueTypeSingleSelect, PropertyValueTypeURL:
		s, ok := cp.DefaultValue.(string)
		return s, ok
	default:
		return "", false
	}
}

// DefaultValueStrings returns the DefaultValue as a slice of string if the ValueType is string or multi_select.
func (cp CustomProperty) DefaultValueStrings() ([]string, bool) {
	switch cp.ValueType {
	case PropertyValueTypeMultiSelect:
		s, ok := cp.DefaultValue.([]string)
		return s, ok
	default:
		return nil, false
	}
}

// DefaultValueBool returns the DefaultValue as a string if the ValueType is string or true_false.
func (cp CustomProperty) DefaultValueBool() (bool, bool) {
	switch cp.ValueType {
	case PropertyValueTypeTrueFalse:
		if s, ok := cp.DefaultValue.(string); ok {
			b, err := strconv.ParseBool(s)
			return b, err == nil
		}
		return false, false
	default:
		return false, false
	}
}

// RepoCustomPropertyValue represents a repository custom property value.
type RepoCustomPropertyValue struct {
	RepositoryID       int64                  `json:"repository_id"`
	RepositoryName     string                 `json:"repository_name"`
	RepositoryFullName string                 `json:"repository_full_name"`
	Properties         []*CustomPropertyValue `json:"properties"`
}

// CustomPropertyValue represents a custom property value.
type CustomPropertyValue struct {
	PropertyName string `json:"property_name"`
	Value        any    `json:"value"`

Review comment (suggestion):
```suggestion
// DefaultValueBool returns the DefaultValue as a string if the ValueType is true_false.
```

Code after:
	ValuesEditableBy *string `json:"values_editable_by,omitempty"`
}

// DefaultValueString returns the DefaultValue as a string if the ValueType is string or single_select or url.
func (cp CustomProperty) DefaultValueString() (string, bool) {
	switch cp.ValueType {
	case PropertyValueTypeString, PropertyValueTypeSingleSelect, PropertyValueTypeURL:
		s, ok := cp.DefaultValue.(string)
		return s, ok
	default:
		return "", false
	}
}

// DefaultValueStrings returns the DefaultValue as a slice of string if the ValueType is multi_select.
func (cp CustomProperty) DefaultValueStrings() ([]string, bool) {
	switch cp.ValueType {
	case PropertyValueTypeMultiSelect:
		s, ok := cp.DefaultValue.([]string)
		return s, ok
	default:
		return nil, false
	}
}

// DefaultValueBool returns the DefaultValue as a string if the ValueType is true_false.
func (cp CustomProperty) DefaultValueBool() (bool, bool) {
	switch cp.ValueType {
	case PropertyValueTypeTrueFalse:
		if s, ok := cp.DefaultValue.(string); ok {
			b, err := strconv.ParseBool(s)
			return b, err == nil
		}
		return false, false
	default:
		return false, false
	}
}

// RepoCustomPropertyValue represents a repository custom property value.
type RepoCustomPropertyValue struct {
	RepositoryID       int64                  `json:"repository_id"`
	RepositoryName     string                 `json:"repository_name"`
	RepositoryFullName string                 `json:"repository_full_name"`
	Properties         []*CustomPropertyValue `json:"properties"`
}

// CustomPropertyValue represents a custom property value.
type CustomPropertyValue struct {
	PropertyName string `json:"property_name"`
	Value        any    `json:"value"`