blob: c2d4fe17799d61ab0ef704392e27cafd99ed6883 [file] [log] [blame]
{{> header excludeZapComment=true}}
#import "MTRCommandPayloadsObjc.h"
NS_ASSUME_NONNULL_BEGIN
{{#zcl_clusters}}
{{#zcl_commands}}
@implementation MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params
- (instancetype)init
{
if (self = [super init]) {
{{#zcl_command_arguments}}
{{>init_struct_member label=label type=type cluster=parent.parent.name}}
{{/zcl_command_arguments}}
_timedInvokeTimeoutMs = nil;
}
return self;
}
- (id)copyWithZone:(NSZone * _Nullable)zone;
{
auto other = [[MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params alloc] init];
{{#zcl_command_arguments}}
other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}};
{{/zcl_command_arguments}}
other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
return other;
}
- (NSString *)description
{
NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_command_arguments}}{{asStructPropertyName label}}:%@; {{/zcl_command_arguments}}>", NSStringFromClass([self class]) {{#zcl_command_arguments}},{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}}{{/zcl_command_arguments}}];
return descriptionString;
}
@end
{{#*inline "deprecatedImpl"}}
@implementation MTR{{compatClusterNameRemapping parent.name}}Cluster{{asUpperCamelCase name}}Params
@end
{{/inline}}
{{#unless (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))}}
{{> deprecatedImpl}}
{{else}}
{{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (asUpperCamelCase name))}}
{{> deprecatedImpl}}
{{/unless}}
{{/unless}}
{{/zcl_commands}}
{{/zcl_clusters}}
NS_ASSUME_NONNULL_END