asRequest method
Implementation
@override
ResourceDeclareRequest asRequest() {
var resource = $p.ResourceIdentifier(
name: name,
type: $p.ResourceType.Api,
);
var apiResource = $p.ApiResource();
for (var opt in opts.security) {
unawaited(attachOidc(name, opt).onError((error, stackTrace) {
print(error);
}));
apiResource.security[opt.name] = $p.ApiScopes(scopes: opt.scopes);
}
return $p.ResourceDeclareRequest(id: resource, api: apiResource);
}