{% for method in swagger_data.crud %}
{% if 'param' in swagger_data.attr_classes_crud[method] %}
{% if 'response' in swagger_data.attr_classes_crud[method] %}
- (BOOL){{method}}{{swagger_data.name|class_name_syntax}}With:(IoT{{(swagger_data.attr_classes_crud[method])["param"]|class_name_syntax}}Attr *)attr
                completion:(void(^)(IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr *outAttr, BOOL success))completion
                completionQueue:(dispatch_queue_t)completionQueue
{
    makeWeak(self)
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient postAttributes:[attr packWritable]
                            queryParameters:@{}
                        completion:^(IoTWrappedRepresentation * _Nonnull wrapped, BOOL status) {
                                                    makeStrongAndReturnIfNil(self)
                                                    if (completion) {
                                                        IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr *outVar = [[IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr alloc] initWithStateSyncQueue:self.stateSyncQueue];
                                                        [outVar unpack:wrapped];
                                                        completion(outVar, status);
                                                    }
                                } completionQueue:completionQueue];
}
{% else %}
- (BOOL){{method}}{{swagger_data.name|class_name_syntax}}With:(IoT{{(swagger_data.attr_classes_crud[method])["param"]|class_name_syntax}}Attr *)attr
                completion:(void(^)(BOOL success))completion
                completionQueue:(dispatch_queue_t)completionQueue
{
    makeWeak(self)
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient postAttributes:[attr packWritable]
                            queryParameters:@{}
                                completion:^(IoTWrappedRepresentation * _Nonnull wrapped, BOOL status) {
                                                    makeStrongAndReturnIfNil(self)
                                                    if (completion) {
                                                        completion(status);
                                                    }
                                } completionQueue:completionQueue];
}
{% endif %}
{% else %}
{% if 'response' in swagger_data.attr_classes_crud[method] %}
- (BOOL){{method}}{{swagger_data.name|class_name_syntax}}WithCompletion:(void(^)(IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr *outAttr, BOOL success))completion
                completionQueue:(dispatch_queue_t)completionQueue
{
    makeWeak(self)
{% if 'get' in method %}
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient getWithQueryParameters:@{}
{% else %}
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient postAttributes:[IoTWrappedRepresentation emptyWrapper]
                            queryParameters:@{}
{% endif %}
                            
                                completion:^(IoTWrappedRepresentation * _Nonnull wrapped, BOOL status) {
                                                    makeStrongAndReturnIfNil(self)
                                                    if (completion) {
                                                        IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr *outVar = [[IoT{{(swagger_data.attr_classes_crud[method])["response"]|class_name_syntax}}Attr alloc] initWithStateSyncQueue:self.stateSyncQueue];
                                                        [outVar unpack:wrapped];
                                                        completion(outVar, status);
                                                    }
                                } completionQueue:completionQueue];
}
{% else %}
- (BOOL){{method}}{{swagger_data.name|class_name_syntax}}WithCompletion:(void(^)(BOOL success))completion
                completionQueue:(dispatch_queue_t)completionQueue
{
    makeWeak(self)
{% if 'get' in method %}
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient getWithQueryParameters:@{}
{% else %}
    return [self.{{swagger_data.name|variable_syntax(True, False)}}ResourceClient postAttributes:[IoTWrappedRepresentation emptyWrapper]
                            queryParameters:@{}
{% endif %}
                                completion:^(IoTWrappedRepresentation * _Nonnull wrapped, BOOL status) {
                                                    makeStrongAndReturnIfNil(self)
                                                    if (completion) {
                                                        completion(status);
                                                    }
                                } completionQueue:completionQueue];
}
{% endif %}
{% endif %}

{% endfor %}
