|
| 1 | +package models |
| 2 | + |
| 3 | +import ( |
| 4 | + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" |
| 5 | +) |
| 6 | + |
| 7 | +// ReplaceBranchVersions |
| 8 | +type ReplaceBranchVersions struct { |
| 9 | + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 10 | + additionalData map[string]any |
| 11 | + // The versions property |
| 12 | + versions []string |
| 13 | +} |
| 14 | + |
| 15 | +// NewReplaceBranchVersions instantiates a new ReplaceBranchVersions and sets the default values. |
| 16 | +func NewReplaceBranchVersions() *ReplaceBranchVersions { |
| 17 | + m := &ReplaceBranchVersions{} |
| 18 | + m.SetAdditionalData(make(map[string]any)) |
| 19 | + return m |
| 20 | +} |
| 21 | + |
| 22 | +// CreateReplaceBranchVersionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value |
| 23 | +func CreateReplaceBranchVersionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { |
| 24 | + return NewReplaceBranchVersions(), nil |
| 25 | +} |
| 26 | + |
| 27 | +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 28 | +func (m *ReplaceBranchVersions) GetAdditionalData() map[string]any { |
| 29 | + return m.additionalData |
| 30 | +} |
| 31 | + |
| 32 | +// GetFieldDeserializers the deserialization information for the current model |
| 33 | +func (m *ReplaceBranchVersions) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { |
| 34 | + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) |
| 35 | + res["versions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { |
| 36 | + val, err := n.GetCollectionOfPrimitiveValues("string") |
| 37 | + if err != nil { |
| 38 | + return err |
| 39 | + } |
| 40 | + if val != nil { |
| 41 | + res := make([]string, len(val)) |
| 42 | + for i, v := range val { |
| 43 | + if v != nil { |
| 44 | + res[i] = *(v.(*string)) |
| 45 | + } |
| 46 | + } |
| 47 | + m.SetVersions(res) |
| 48 | + } |
| 49 | + return nil |
| 50 | + } |
| 51 | + return res |
| 52 | +} |
| 53 | + |
| 54 | +// GetVersions gets the versions property value. The versions property |
| 55 | +func (m *ReplaceBranchVersions) GetVersions() []string { |
| 56 | + return m.versions |
| 57 | +} |
| 58 | + |
| 59 | +// Serialize serializes information the current object |
| 60 | +func (m *ReplaceBranchVersions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { |
| 61 | + if m.GetVersions() != nil { |
| 62 | + err := writer.WriteCollectionOfStringValues("versions", m.GetVersions()) |
| 63 | + if err != nil { |
| 64 | + return err |
| 65 | + } |
| 66 | + } |
| 67 | + { |
| 68 | + err := writer.WriteAdditionalData(m.GetAdditionalData()) |
| 69 | + if err != nil { |
| 70 | + return err |
| 71 | + } |
| 72 | + } |
| 73 | + return nil |
| 74 | +} |
| 75 | + |
| 76 | +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 77 | +func (m *ReplaceBranchVersions) SetAdditionalData(value map[string]any) { |
| 78 | + m.additionalData = value |
| 79 | +} |
| 80 | + |
| 81 | +// SetVersions sets the versions property value. The versions property |
| 82 | +func (m *ReplaceBranchVersions) SetVersions(value []string) { |
| 83 | + m.versions = value |
| 84 | +} |
| 85 | + |
| 86 | +// ReplaceBranchVersionsable |
| 87 | +type ReplaceBranchVersionsable interface { |
| 88 | + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder |
| 89 | + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable |
| 90 | + GetVersions() []string |
| 91 | + SetVersions(value []string) |
| 92 | +} |
0 commit comments