-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension_model_hal_link_data.go
54 lines (46 loc) · 1.41 KB
/
extension_model_hal_link_data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright (C) 2020-2024 Arm Limited or its affiliates and Contributors. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// Package client defines an HTTP client for communicating with the web services.
// It includes the definition of request/response types as well as provides helpers for calling specific helpers.
package client
import (
"errors"
)
// *************************************************************************************
// NOTE: this file is not generated.
// It extends the generated models.
// *************************************************************************************
// FetchType returns the resource type
func (o *HalLinkData) FetchType() string {
return "HAL link"
}
// HalLinkDataIterator defines an iterator over a message collection.
type HalLinkDataIterator struct {
elements []HalLinkData
currentIndex int
}
func (m *HalLinkDataIterator) HasNext() bool {
return m.currentIndex < len(m.elements)
}
func (m *HalLinkDataIterator) GetNext() (item interface{}, err error) {
if m.currentIndex < 0 {
err = errors.New("incorrect element index")
return
}
if !m.HasNext() {
err = errors.New("no more items")
return
}
element := m.elements[m.currentIndex]
item = &element
m.currentIndex++
return
}
func NewHalLinkDataIterator(elements []HalLinkData) (IIterator, error) {
return &HalLinkDataIterator{
elements: elements,
currentIndex: 0,
}, nil
}