go-client icon indicating copy to clipboard operation
go-client copied to clipboard

Missing Create Identity-provider API

Open Raghavsalotra opened this issue 3 years ago • 3 comments

Is there a way to create identity-provider using golang client. I don't see any implementation in client.go for creating one.

Raghavsalotra avatar May 17 '22 10:05 Raghavsalotra

Hmmm. I don't think so. It looks like that operation is explicitly not created due to complexities around the JSON mapping: https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/go.client.ftl#L186

Two options you might explore:

  • You can create the JSON in golang and call the API directly using any REST client, including the provided restClient: https://github.com/FusionAuth/go-client/blob/master/pkg/fusionauth/Client.go#L64
  • You could generate a golang client with our OpenAPI spec, which includes the identity provider create operation: https://github.com/FusionAuth/fusionauth-openapi/blob/master/openapi.yaml#L12864 Note that different languages have different levels of support for polymorphic parameters, which are required for this operation. This one: https://openapi-generator.tech/docs/generators/go looks to support polymorphism.

mooreds avatar May 17 '22 14:05 mooreds