/
datasecuritylineofservice.go
88 lines (76 loc) · 2.78 KB
/
datasecuritylineofservice.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// SPDX-License-Identifier: BSD-3-Clause
//
package swordfish
import (
"encoding/json"
"github.com/stmcginnis/gofish/common"
)
// DataSecurityLineOfService is used to describe data security service
// level requirements.
type DataSecurityLineOfService struct {
common.Entity
// ODataContext is the odata context.
ODataContext string `json:"@odata.context"`
// ODataType is the odata type.
ODataType string `json:"@odata.type"`
// AntivirusEngineProvider shall specify an AntiVirus provider.
AntivirusEngineProvider string
// AntivirusScanPolicies shall specify the
// policy for triggering an AntiVirus scan.
AntivirusScanPolicies []AntiVirusScanTrigger
// ChannelEncryptionStrength shall specify a key size in a symmetric
// encryption algorithm for transport channel encryption.
ChannelEncryptionStrength KeySize
// DataSanitizationPolicy shall specify the data sanitization policy.
DataSanitizationPolicy DataSanitizationPolicy
// Description provides a description of this resource.
Description string
// HostAuthenticationType shall specify the
// authentication type for hosts (servers) or initiator endpoints.
HostAuthenticationType AuthenticationType
// MediaEncryptionStrength shall specify a key
// size in a symmetric encryption algorithm for media encryption.
MediaEncryptionStrength KeySize
// SecureChannelProtocol shall specify the
// protocol that provide encrypted communication.
SecureChannelProtocol SecureChannelProtocol
// UserAuthenticationType shall specify the
// authentication type for users (or programs).
UserAuthenticationType AuthenticationType
}
// GetDataSecurityLineOfService will get a DataSecurityLineOfService instance from the service.
func GetDataSecurityLineOfService(c common.Client, uri string) (*DataSecurityLineOfService, error) {
resp, err := c.Get(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var datasecuritylineofservice DataSecurityLineOfService
err = json.NewDecoder(resp.Body).Decode(&datasecuritylineofservice)
if err != nil {
return nil, err
}
datasecuritylineofservice.SetClient(c)
return &datasecuritylineofservice, nil
}
// ListReferencedDataSecurityLineOfServices gets the collection of DataSecurityLineOfService from
// a provided reference.
func ListReferencedDataSecurityLineOfServices(c common.Client, link string) ([]*DataSecurityLineOfService, error) {
var result []*DataSecurityLineOfService
if link == "" {
return result, nil
}
links, err := common.GetCollection(c, link)
if err != nil {
return result, err
}
for _, datasecuritylineofserviceLink := range links.ItemLinks {
datasecuritylineofservice, err := GetDataSecurityLineOfService(c, datasecuritylineofserviceLink)
if err != nil {
return result, err
}
result = append(result, datasecuritylineofservice)
}
return result, nil
}