@@ -16,8 +16,6 @@ type ModuleVersions interface {
1616 List (ctx context.Context , options ModuleVersionListOptions ) (* ModuleVersionList , error )
1717 // Read a module version by its ID.
1818 Read (ctx context.Context , moduleVersionID string ) (* ModuleVersion , error )
19- // ReadBySemanticVersion read module version by module and semantic version
20- ReadBySemanticVersion (ctx context.Context , moduleId string , version string ) (* ModuleVersion , error )
2119}
2220
2321// moduleVersions implements ModuleVersions.
@@ -105,32 +103,3 @@ func (s *moduleVersions) List(ctx context.Context, options ModuleVersionListOpti
105103
106104 return mv , nil
107105}
108-
109- func (s * moduleVersions ) ReadBySemanticVersion (ctx context.Context , moduleID string , version string ) (* ModuleVersion , error ) {
110- if ! validStringID (& moduleID ) {
111- return nil , errors .New ("invalid value for module id" )
112- }
113-
114- v := & version
115- if ! validString (v ) {
116- return nil , errors .New ("invalid value for version" )
117- }
118-
119- req , err := s .client .newRequest ("GET" , "module-versions" , & ModuleVersionListOptions {Module : moduleID , Version : v })
120- if err != nil {
121- return nil , err
122- }
123-
124- mvl := & ModuleVersionList {}
125- err = s .client .do (ctx , req , mvl )
126- if err != nil {
127- return nil , err
128- }
129- if len (mvl .Items ) != 1 {
130- return nil , ResourceNotFoundError {
131- Message : fmt .Sprintf ("ModuleVersion with Module ID '%v' and version '%v' not found." , moduleID , version ),
132- }
133- }
134-
135- return mvl .Items [0 ], nil
136- }
0 commit comments