-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add data source user #648
add data source user #648
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fixes and we're ready
identity/data_user.go
Outdated
func DataSourceUser() *schema.Resource { | ||
type entity struct { | ||
UserName string `json:"user_name"` | ||
Home string `json:"home" tf:"computed"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run make fmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
identity/data_user.go
Outdated
Alphanumeric string `json:"alphanumeric" tf:"computed"` | ||
} | ||
|
||
s := common.StructToSchema(entity{}, func( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, if you feel that schema map is shorter - you can do it as well :) just a side thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
identity/data_user.go
Outdated
s := common.StructToSchema(entity{}, func( | ||
s map[string]*schema.Schema) map[string]*schema.Schema { | ||
// nolint once SDKv2 has Diagnostics-returning validators, change | ||
s["user_name"].ValidateFunc = validation.StringIsNotEmpty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've migrated to other linter, so comment above might not work. You need ValidateDiagFunc and wrap this sdkv1 one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's done now that I've changed to schema map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Issue: #647