Coverage Report

Created: 2026-06-30 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/AccessControl/Structs.h
Line
Count
Source
1
/*
2
 *
3
 *    Copyright (c) 2022 Project CHIP Authors
4
 *
5
 *    Licensed under the Apache License, Version 2.0 (the "License");
6
 *    you may not use this file except in compliance with the License.
7
 *    You may obtain a copy of the License at
8
 *
9
 *        http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *    Unless required by applicable law or agreed to in writing, software
12
 *    distributed under the License is distributed on an "AS IS" BASIS,
13
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *    See the License for the specific language governing permissions and
15
 *    limitations under the License.
16
 */
17
18
// THIS FILE IS GENERATED BY ZAP
19
// This file is generated from clusters-Structs.h.zapt
20
21
#pragma once
22
23
#include <app/data-model/DecodableList.h>
24
#include <app/data-model/List.h>
25
#include <app/data-model/Nullable.h>
26
#include <lib/core/DataModelTypes.h>
27
#include <lib/core/Optional.h>
28
#include <lib/core/TLV.h>
29
#include <lib/support/BitMask.h>
30
31
#include <clusters/shared/Structs.h>
32
33
#include <cstdint>
34
35
namespace chip {
36
namespace app {
37
namespace Clusters {
38
namespace AccessControl {
39
namespace Structs {
40
namespace AccessRestrictionStruct {
41
enum class Fields : uint8_t
42
{
43
    kType = 0,
44
    kId   = 1,
45
};
46
47
struct Type
48
{
49
public:
50
    AccessRestrictionTypeEnum type = static_cast<AccessRestrictionTypeEnum>(0);
51
    DataModel::Nullable<uint32_t> id;
52
53
    CHIP_ERROR Decode(TLV::TLVReader & reader);
54
55
    static constexpr bool kIsFabricScoped = false;
56
57
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
58
};
59
60
using DecodableType = Type;
61
62
} // namespace AccessRestrictionStruct
63
namespace CommissioningAccessRestrictionEntryStruct {
64
enum class Fields : uint8_t
65
{
66
    kEndpoint     = 0,
67
    kCluster      = 1,
68
    kRestrictions = 2,
69
};
70
71
struct Type
72
{
73
public:
74
    chip::EndpointId endpoint = static_cast<chip::EndpointId>(0);
75
    chip::ClusterId cluster   = static_cast<chip::ClusterId>(0);
76
    DataModel::List<const Structs::AccessRestrictionStruct::Type> restrictions;
77
78
    static constexpr bool kIsFabricScoped = false;
79
80
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
81
};
82
83
struct DecodableType
84
{
85
public:
86
    chip::EndpointId endpoint = static_cast<chip::EndpointId>(0);
87
    chip::ClusterId cluster   = static_cast<chip::ClusterId>(0);
88
    DataModel::DecodableList<Structs::AccessRestrictionStruct::DecodableType> restrictions;
89
90
    CHIP_ERROR Decode(TLV::TLVReader & reader);
91
92
    static constexpr bool kIsFabricScoped = false;
93
};
94
95
} // namespace CommissioningAccessRestrictionEntryStruct
96
namespace AccessRestrictionEntryStruct {
97
enum class Fields : uint8_t
98
{
99
    kEndpoint     = 0,
100
    kCluster      = 1,
101
    kRestrictions = 2,
102
    kFabricIndex  = 254,
103
};
104
105
struct Type
106
{
107
public:
108
    chip::EndpointId endpoint = static_cast<chip::EndpointId>(0);
109
    chip::ClusterId cluster   = static_cast<chip::ClusterId>(0);
110
    DataModel::List<const Structs::AccessRestrictionStruct::Type> restrictions;
111
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
112
113
    static constexpr bool kIsFabricScoped = true;
114
115
0
    auto GetFabricIndex() const { return fabricIndex; }
116
117
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
118
119
    CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
120
    CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const;
121
122
private:
123
    CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional<FabricIndex> & aAccessingFabricIndex) const;
124
};
125
126
struct DecodableType
127
{
128
public:
129
    chip::EndpointId endpoint = static_cast<chip::EndpointId>(0);
130
    chip::ClusterId cluster   = static_cast<chip::ClusterId>(0);
131
    DataModel::DecodableList<Structs::AccessRestrictionStruct::DecodableType> restrictions;
132
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
133
134
    CHIP_ERROR Decode(TLV::TLVReader & reader);
135
136
    static constexpr bool kIsFabricScoped = true;
137
138
0
    auto GetFabricIndex() const { return fabricIndex; }
139
140
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
141
};
142
143
} // namespace AccessRestrictionEntryStruct
144
namespace AccessControlTargetStruct {
145
enum class Fields : uint8_t
146
{
147
    kCluster    = 0,
148
    kEndpoint   = 1,
149
    kDeviceType = 2,
150
};
151
152
struct Type
153
{
154
public:
155
    DataModel::Nullable<chip::ClusterId> cluster;
156
    DataModel::Nullable<chip::EndpointId> endpoint;
157
    DataModel::Nullable<chip::DeviceTypeId> deviceType;
158
159
    CHIP_ERROR Decode(TLV::TLVReader & reader);
160
161
    static constexpr bool kIsFabricScoped = false;
162
163
    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
164
};
165
166
using DecodableType = Type;
167
168
} // namespace AccessControlTargetStruct
169
namespace AccessControlEntryStruct {
170
enum class Fields : uint8_t
171
{
172
    kPrivilege     = 1,
173
    kAuthMode      = 2,
174
    kSubjects      = 3,
175
    kTargets       = 4,
176
    kAuxiliaryType = 5,
177
    kFabricIndex   = 254,
178
};
179
180
struct Type
181
{
182
public:
183
    AccessControlEntryPrivilegeEnum privilege = static_cast<AccessControlEntryPrivilegeEnum>(0);
184
    AccessControlEntryAuthModeEnum authMode   = static_cast<AccessControlEntryAuthModeEnum>(0);
185
    DataModel::Nullable<DataModel::List<const uint64_t>> subjects;
186
    DataModel::Nullable<DataModel::List<const Structs::AccessControlTargetStruct::Type>> targets;
187
    Optional<AccessControlAuxiliaryTypeEnum> auxiliaryType;
188
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
189
190
    static constexpr bool kIsFabricScoped = true;
191
192
0
    auto GetFabricIndex() const { return fabricIndex; }
193
194
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
195
196
    CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
197
    CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const;
198
199
private:
200
    CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional<FabricIndex> & aAccessingFabricIndex) const;
201
};
202
203
struct DecodableType
204
{
205
public:
206
    AccessControlEntryPrivilegeEnum privilege = static_cast<AccessControlEntryPrivilegeEnum>(0);
207
    AccessControlEntryAuthModeEnum authMode   = static_cast<AccessControlEntryAuthModeEnum>(0);
208
    DataModel::Nullable<DataModel::DecodableList<uint64_t>> subjects;
209
    DataModel::Nullable<DataModel::DecodableList<Structs::AccessControlTargetStruct::DecodableType>> targets;
210
    Optional<AccessControlAuxiliaryTypeEnum> auxiliaryType;
211
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
212
213
    CHIP_ERROR Decode(TLV::TLVReader & reader);
214
215
    static constexpr bool kIsFabricScoped = true;
216
217
0
    auto GetFabricIndex() const { return fabricIndex; }
218
219
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
220
};
221
222
} // namespace AccessControlEntryStruct
223
namespace AccessControlExtensionStruct {
224
enum class Fields : uint8_t
225
{
226
    kData        = 1,
227
    kFabricIndex = 254,
228
};
229
230
struct Type
231
{
232
public:
233
    chip::ByteSpan data;
234
    chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
235
236
    CHIP_ERROR Decode(TLV::TLVReader & reader);
237
238
    static constexpr bool kIsFabricScoped = true;
239
240
0
    auto GetFabricIndex() const { return fabricIndex; }
241
242
0
    void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; }
243
244
    CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
245
    CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const;
246
247
private:
248
    CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional<FabricIndex> & aAccessingFabricIndex) const;
249
};
250
251
using DecodableType = Type;
252
253
} // namespace AccessControlExtensionStruct
254
} // namespace Structs
255
} // namespace AccessControl
256
} // namespace Clusters
257
} // namespace app
258
} // namespace chip