@@ -153,17 +153,29 @@ func (s *ArtifactsGenericArtifactResourceCrud) DeletedTarget() []string {
153153 }
154154}
155155
156- func (s * ArtifactsGenericArtifactResourceCrud ) Get () error {
157- request := oci_artifacts.GetGenericArtifactRequest {}
156+ func (s * ArtifactsGenericArtifactResourceCrud ) Create () error {
157+ request := oci_artifacts.UpdateGenericArtifactRequest {}
158158
159159 if artifactId , ok := s .D .GetOkExists ("artifact_id" ); ok {
160160 tmp := artifactId .(string )
161161 request .ArtifactId = & tmp
162162 }
163163
164+ if definedTags , ok := s .D .GetOkExists ("defined_tags" ); ok {
165+ convertedDefinedTags , err := mapToDefinedTags (definedTags .(map [string ]interface {}))
166+ if err != nil {
167+ return err
168+ }
169+ request .DefinedTags = convertedDefinedTags
170+ }
171+
172+ if freeformTags , ok := s .D .GetOkExists ("freeform_tags" ); ok {
173+ request .FreeformTags = objectMapToStringMap (freeformTags .(map [string ]interface {}))
174+ }
175+
164176 request .RequestMetadata .RetryPolicy = getRetryPolicy (s .DisableNotFoundRetries , "artifacts" )
165177
166- response , err := s .Client .GetGenericArtifact (context .Background (), request )
178+ response , err := s .Client .UpdateGenericArtifact (context .Background (), request )
167179 if err != nil {
168180 return err
169181 }
@@ -172,29 +184,17 @@ func (s *ArtifactsGenericArtifactResourceCrud) Get() error {
172184 return nil
173185}
174186
175- func (s * ArtifactsGenericArtifactResourceCrud ) Create () error {
176- request := oci_artifacts.UpdateGenericArtifactRequest {}
187+ func (s * ArtifactsGenericArtifactResourceCrud ) Get () error {
188+ request := oci_artifacts.GetGenericArtifactRequest {}
177189
178190 if artifactId , ok := s .D .GetOkExists ("artifact_id" ); ok {
179191 tmp := artifactId .(string )
180192 request .ArtifactId = & tmp
181193 }
182194
183- if definedTags , ok := s .D .GetOkExists ("defined_tags" ); ok {
184- convertedDefinedTags , err := mapToDefinedTags (definedTags .(map [string ]interface {}))
185- if err != nil {
186- return err
187- }
188- request .DefinedTags = convertedDefinedTags
189- }
190-
191- if freeformTags , ok := s .D .GetOkExists ("freeform_tags" ); ok {
192- request .FreeformTags = objectMapToStringMap (freeformTags .(map [string ]interface {}))
193- }
194-
195195 request .RequestMetadata .RetryPolicy = getRetryPolicy (s .DisableNotFoundRetries , "artifacts" )
196196
197- response , err := s .Client .UpdateGenericArtifact (context .Background (), request )
197+ response , err := s .Client .GetGenericArtifact (context .Background (), request )
198198 if err != nil {
199199 return err
200200 }
0 commit comments