@@ -16,13 +16,13 @@ import (
1616
1717// Ensure the implementation satisfies the expected interfaces.
1818var (
19- _ resource.Resource = & profileResource {}
20- _ resource.ResourceWithConfigure = & profileResource {}
21- _ resource.ResourceWithImportState = & profileResource {}
19+ _ resource.Resource = & customProfileResource {}
20+ _ resource.ResourceWithConfigure = & customProfileResource {}
21+ _ resource.ResourceWithImportState = & customProfileResource {}
2222)
2323
2424// profileResourceModel maps the resource schema data.
25- type profileResourceModel struct {
25+ type customProfileResourceModel struct {
2626 Name types.String `tfsdk:"name"`
2727 MobileConfig types.String `tfsdk:"mobileconfig"`
2828 FileSHA types.String `tfsdk:"filesha"`
@@ -35,16 +35,16 @@ type profileResourceModel struct {
3535
3636// ProfileResource is a helper function to simplify the provider implementation.
3737func CustomProfileResource () resource.Resource {
38- return & profileResource {}
38+ return & customProfileResource {}
3939}
4040
4141// profileResource is the resource implementation.
42- type profileResource struct {
42+ type customProfileResource struct {
4343 client * simplemdm.Client
4444}
4545
4646// Configure adds the provider configured client to the resource.
47- func (r * profileResource ) Configure (_ context.Context , req resource.ConfigureRequest , _ * resource.ConfigureResponse ) {
47+ func (r * customProfileResource ) Configure (_ context.Context , req resource.ConfigureRequest , _ * resource.ConfigureResponse ) {
4848 if req .ProviderData == nil {
4949 return
5050 }
@@ -53,12 +53,12 @@ func (r *profileResource) Configure(_ context.Context, req resource.ConfigureReq
5353}
5454
5555// Metadata returns the resource type name.
56- func (r * profileResource ) Metadata (_ context.Context , req resource.MetadataRequest , resp * resource.MetadataResponse ) {
56+ func (r * customProfileResource ) Metadata (_ context.Context , req resource.MetadataRequest , resp * resource.MetadataResponse ) {
5757 resp .TypeName = req .ProviderTypeName + "_customprofile"
5858}
5959
6060// Schema defines the schema for the resource.
61- func (r * profileResource ) Schema (_ context.Context , _ resource.SchemaRequest , resp * resource.SchemaResponse ) {
61+ func (r * customProfileResource ) Schema (_ context.Context , _ resource.SchemaRequest , resp * resource.SchemaResponse ) {
6262 resp .Schema = schema.Schema {
6363 Description : "Custom Profile resource can be used to manage Custom Profile. Can be used together with Device(s), Assignment Group(s) or Device Group(s) and set addition details regarding Custom Profile." ,
6464 Attributes : map [string ]schema.Attribute {
@@ -112,15 +112,15 @@ func (r *profileResource) Schema(_ context.Context, _ resource.SchemaRequest, re
112112 }
113113}
114114
115- func (r * profileResource ) ImportState (ctx context.Context , req resource.ImportStateRequest , resp * resource.ImportStateResponse ) {
115+ func (r * customProfileResource ) ImportState (ctx context.Context , req resource.ImportStateRequest , resp * resource.ImportStateResponse ) {
116116 // Retrieve import ID and save to id attribute
117117 resource .ImportStatePassthroughID (ctx , path .Root ("id" ), req , resp )
118118}
119119
120120// Create a new resource
121- func (r * profileResource ) Create (ctx context.Context , req resource.CreateRequest , resp * resource.CreateResponse ) {
121+ func (r * customProfileResource ) Create (ctx context.Context , req resource.CreateRequest , resp * resource.CreateResponse ) {
122122 //Retrieve values from plan
123- var plan profileResourceModel
123+ var plan customProfileResourceModel
124124 diags := req .Plan .Get (ctx , & plan )
125125 resp .Diagnostics .Append (diags ... )
126126 if resp .Diagnostics .HasError () {
@@ -148,9 +148,9 @@ func (r *profileResource) Create(ctx context.Context, req resource.CreateRequest
148148 }
149149}
150150
151- func (r * profileResource ) Read (ctx context.Context , req resource.ReadRequest , resp * resource.ReadResponse ) {
151+ func (r * customProfileResource ) Read (ctx context.Context , req resource.ReadRequest , resp * resource.ReadResponse ) {
152152 // Get current state
153- var state profileResourceModel
153+ var state customProfileResourceModel
154154 diags := req .State .Get (ctx , & state )
155155 resp .Diagnostics .Append (diags ... )
156156 if resp .Diagnostics .HasError () {
@@ -215,9 +215,9 @@ func (r *profileResource) Read(ctx context.Context, req resource.ReadRequest, re
215215 }
216216}
217217
218- func (r * profileResource ) Update (ctx context.Context , req resource.UpdateRequest , resp * resource.UpdateResponse ) {
218+ func (r * customProfileResource ) Update (ctx context.Context , req resource.UpdateRequest , resp * resource.UpdateResponse ) {
219219 //Retrieve values from plan
220- var plan profileResourceModel
220+ var plan customProfileResourceModel
221221 diags := req .Plan .Get (ctx , & plan )
222222 resp .Diagnostics .Append (diags ... )
223223 if resp .Diagnostics .HasError () {
@@ -241,15 +241,15 @@ func (r *profileResource) Update(ctx context.Context, req resource.UpdateRequest
241241 }
242242}
243243
244- func (r * profileResource ) Delete (ctx context.Context , req resource.DeleteRequest , resp * resource.DeleteResponse ) {
245- var state profileResourceModel
244+ func (r * customProfileResource ) Delete (ctx context.Context , req resource.DeleteRequest , resp * resource.DeleteResponse ) {
245+ var state customProfileResourceModel
246246 diags := req .State .Get (ctx , & state )
247247 resp .Diagnostics .Append (diags ... )
248248 if resp .Diagnostics .HasError () {
249249 return
250250 }
251251
252- // Delete existing order
252+ // Delete existing custom profile
253253 err := r .client .CustomProfileDelete (state .ID .ValueString ())
254254 if err != nil {
255255 resp .Diagnostics .AddError (
0 commit comments